In the old days we did something like this:
FILE = fopen()
while ( !FEOF(FILE) )
{
** Do something here reading or writing
}
This is the basic simple file manipulation we used in ANSI C and VFP.
As far as I can tell C# has broken this down into stream readers, stream writers, file streams, file info objects, asynchronous readers and writers, blah blah blah. I don't want a reader and a separate writer. I want a reader/writer on the same existing file that I can read from and insert to.
All I want to do is open a text file, search for certain strings, and insert text at those locations. Why is this such a pain? As near as I can tell I am going to need to open an existing file, read it into a new file with my changes, delete the old file, and rename the new one?
Or perhaps spend another day reading and writing to a FileStream at the byte level?
There must be an easier way to scan and edit a text file.
Eric Kleeman - EDS Consulting Services
MCP Visual FoxPro
MCSD C#.NET
Hua Hin Thailand
Los Angeles California