I am trying to isolate a nasty bug, which brings down my linux kernel. I am printing messages to stderr and stderr is redirected to a log file. Is there a way to disable buffering on the file access? When kernel hangs, I am losing the messages in the buffer.
...
Is it possible to clear a file preserving its timestamp, using standard Linux commands? For example:
echo "" > file-name
converts the text file to empty, this is OK for me. But I need to keep the timestamp unchanged.
...
I read limited (small - 15 - 500 mb files).
I need to be able to put all file bytes into one single bytearray.
So I have a function:
[Bindable]
public var ba:ByteArray = new ByteArray;
//.... code ....//
protected function fileOpenSelected(event:Event):void
{
currentFile = event.target...
I am by no means a programmer but currently am wondering if an application creates a temp file that windows names. For example the file it creates is tmp001, is there a way i can take that name tmp001 and ask windows to give me the next temp file it would create before it creates it.
Thanks,
Mike
...
I have a text file on my server. I want to open the text file from my Android App and then display the text in a TextView. I cannot find any examples of how to do a basic connection to a server and feed the data into a String.
Any help you can provide would be appreciated.
...
For some reason, I keep getting a '1' for the file names with this code:
if (is_dir($log_directory))
{
if ($handle = opendir($log_directory))
{
while($file = readdir($handle) !== FALSE)
{
$results_array[] = $file;
}
closedir($handle);
}
}
When I echo each element in $results_arra...
How can I detect if a file is binary or a plain text?
Basically my .NET app is processing batch files and extracting data however I don't want to process binary files.
As a solution I'm thinking about analysing first X bytes of the file and if there are more unprintable characters than printable characters it should be binary.
Is thi...
I am looking for a code, which I can use for list 5 most recent files recursively in a directory.
Here is a non-recursive code, this one will be perfect for me if it was recursive:
<?php
$show = 0; // Leave as 0 for all
$dir = 'sat/'; // Leave as blank for current
if($dir) chdir($dir);
$files = glob( '*.{html,php,php4,txt}', GLOB...
Since C it's not a language I am used to program with, I don't know how to do this.
I have a project folder where I have all the .c and .h files and a conf folder under which there is a config.txt file to read. How can I open that?
FILE* fp = fopen("/conf/config.txt", "r");
if (fp != NULL)
{
//do stuff
}
else
printf("couldn't ...
I have 3 txt files s1.txt, s2.txt, s3.txt.Each have the same format and number of data.I want to combine only the second column of each of the 3 files into one file. Before I combine the data, I sorted it according to the 1st column:
UnSorted file:
s1.txt s2.txt s3.txt
1 23 2 33 3 22
4 32 4 32 2 11
5 22 1 10 ...
Hello,
I am creating an Excel file on a web server, using OleDb to connect the the physical (well as physical as it can be) file and appending records. I am then returning a FilePathResult to the user via MVC, and would like to delete the physical file afterwards due to data protection concerns over the appended records.
I have tried u...
I guess many people already read this article:
Using your own SQLite database in Android applications: http://www.reigndesign.com/blog/using-your-own-sqlite-database-in-android-applications/comment-page-2/#comment-12368
However it's keep bringing IOException at
while ((length = myInput.read(buffer))>0){
myOutput.write(buffer, 0, l...
Hey there,
I'm building an app that allows a user to select or take a photo then it is saved as a jpeg to the app's documents directory. Everything works perfectly, however, I realized that each time I build and run the Xcode project on the device, in reinstalls the app thus creating a new documents directory path. Is there any way to...
Hello All,
First of all I am very thankful to the owner of this website. I have learned and implement various technologies with the help of solutions provided by the readers.
I know the question I asked is posted many time in this forum. And I have tired all of the solutions available, but no luck
I may case I am trying to read a dat f...
Hello,
Im sure this is a really easy to answer question but I'm still new to cocoa. I need to save my applications data. The app has 4 text fields and each field needs to be saved into one file. Then when you open the file it needs to know what goes in what field. Im really stuck with this. Also, I do know how to use the save panel. Tha...
I'm looking for a good format for archiving entire file-systems of old Linux computers.
TAR.GZ
The tar.gz format is great for archiving files with UNIX-style attributes, but since the compression is applied across the entire archive, the design precludes random-access. Instead, if you want to access a file at the end of the archive, you...
Hi all, I am trying to send the file details one air app to anther air application using tcp. Can anybody help me? Thank you.
...
Hi,
I have a problem with a NSData writeToFile.
I have implemented the code below but i have an anomaly.
When i run my program on the simulator, the new file is created and the informations are stored; when i build the app in my device , the file isn't created.
The debug don't give me any error but don/t save anything.
Can you help me?
T...
Hi,
I have a problem.
I have the code below for save a data on file.
I build my app on the device, and run.
The result variable is TRUE, but i don't find the file on the my iPhone device.
Can you help me?
Thank and sorry for my english XP
-(void)saveXML:(NSString*)name:(float)x:(float)y:(float)z{
NSMutableData *data = [NSMutableD...
I'm trying to parse through fixed-width formatted file extracting x,y values of points from it, and then storing them in int[] array inside a Vector.
Text file looks as follows :
0006 0015
0125 0047
0250 0131
That's the code :
Vector<int[]> vc = new Vector<int[]>();
try {
BufferedReader file = new BufferedR...