My project needs RandomAccessFile,and I have made it.But when testing the Mutiple Access,many problems found.It can not make sure the file access security , no ACID semantics.So I need a framework based on RandomAccessFile to solve this problem.
...
I have an automatically generated file (generator not created by me) which, as its first line, contains the date when it was generated. To simplify my life with Subversion, I want to create a version of this automatically generated files which does not contain this first line.
My guess Is I have to do something like
<ReadLinesFromFile ...
I have, essentially, the same problem as this poster, but in C#: http://stackoverflow.com/questions/1746781/waiting-until-a-file-is-available-for-reading-with-win32
More information: we have code that calls File.Open in one of our projects, that occasionally dies when the file is already opened by another process (EDIT: or thread):
Fil...
I have to deal with a directory of about 2 million xml's to be processed.
I've already solved the processing distributing the work between machines and threads using queues and everything goes right.
But now the big problem is the bottleneck of reading the directory with the 2 million files in order to fill the queues incrementally.
...
Say I have an empty list myNames = []
How can I open a file with names on each line and read in each name into the list?
like
names.txt
dave
jeff
ted
myNames = [dave,jeff,ted]
...
I have an odd bug where my code returns a file not found exception but the file seems to be exactly where it should be. My project has some code to run a system cmdlet and look for the results of the cmdlet in an XML output file. We tell the cmdlet to put this output XML in a custom subdir of the system TEMP dir, e.g., C:\WINDOWS\TEMP\So...
I am writing in fortran and compiling using the g95 compiler.
I need to have a log file output to a DLL i am writing, that is currently linking and running with the master program, but producing incorrect results. I don't know much about FORTRAN, but i did get the following code to produce output in an EXE i compiled:
OPEN(UNIT=3, F...
I have a program that opens a large binary file, appends a small amount of data to it, and closes the file.
FileStream fs = File.Open( "\\\\s1\\temp\\test.tmp", FileMode.Append, FileAccess.Write, FileShare.None );
fs.Write( data, 0, data.Length );
fs.Close();
If test.tmp is 5MB before this program is run and the data array is 100 by...
Hey Everyone!
I'm currently messing around in FORTRAN 77 and I've ran into a problem that I can't seem to figure out. I'm trying to read from a file that looks similar to below:
000120 Description(s) here 18 7 10.15
000176 Description(s) here 65 20 56.95
...
The last column in each row is a monetary...
I have a strange problem with object serialization.
in the file documentation it states as following
The lead in starts with a 4-byte tag
that identifies a TDMS segment
("TDSm"). The next four bytes are used
as a bit mask in order to indicate
what kind of data the segment
contains. This bit mask is referred to
as ToC (Ta...
I have two programs which are accessing a directory using the .NET Directory class static methods.
The first program is only reading a directory, while the second is attempting to rename a directory. The directory being renamed by the second program may not be the same directory that is being read by the first program.
When the second...
Hi all,
I have created a wedsite using MVC 2 and C#. one of the pages is a gallery of product images. i have stored the path to the pictures in the Db eg ../../Content/ProductImages/
in the controler i want to do a foreach and get a list of the files to dispaly. i tried the code below :
List<string> files = new List<string>();
string p...
This is my code:
$zplHandle = fopen($target_file,'w');
fwrite($zplHandle, $zplBlock01);
fwrite($zplHandle, $zplBlock02);
fwrite($zplHandle, $zplBlock03);
fclose($zplHandle);
When will the file be saved? Is it immediately after writing to it or after closing it?
I am asking this because I have Printfil listening to files in a folder a...
The File.listFiles() method lists the contents of a folder. On windows however, when you call the method on your root drive, it also yields some - in lack of a better phrase - "virtual" folders (Like "Documents and Settings", which got replaced by "Users" in recent windows versions).
If you then call listFiles() for one of those "virtua...
Hi, I have the following text file (ExamMarks.txt)
John, 85, 95, 90
Micheal, 60, 75, 75
I want to extract a line and take the Name and separately and the ints separately. Then I want to print the name and the average of the numbers like this in a label:
John's average is 90
Micheal's average is 70
So far I can only display what is ...
Is there a WriteProfileString support directly in C#? I do not want to use the unmanaged function from kernel32.dll.
...
Hello SO!
I am trying to improve performance of elfinder , an ajax based file manager(elRTE.ru) .
It uses os.listdir in a recurisve to walk through all directories recursively and having a performance hit (like listing a dir with 3000 + files takes 7 seconds ) ..
I am trying to improve performance for it here is it's walking function:...
I'm trying to read a binary file (which represents a matrix in Matlab) in Python.
But I am having trouble reading the file and converting the bytes to the correct values.
The binary file consists of a sequence of 4-byte numbers. The first two numbers are the number of rows and columns respectively. My friend gave me a Matlab function he...
I have a file containing data like below:
88_NPDJ 565 789 3434 54454
98HGJDN 945 453 3453 23423
...
...
...
whats the best way to add headers to the file? After data has been entered into the file. The data is tab delimited.
...
Is there any way to determine if a file is open by anything include applications that do not lock the file (like notepad).
I need to detect when a given file myfile.txt is no longer open in any application including notepad - so i cannot use File.Open(...) with exclusive access to test since the file has no lock on it.
...