rockom
July 21st, 2010, 05:24 PM
Hello,
Generally, I'm either read only, or appending to the end of a file. No problems with that.
My latest task is to edit a file.
I have a steam position saved from a previous read operation. I use fsetpos() to position the file pointer for the write. Works great with one exception. It does not delete the line first, so if my new line is shorter than whats already in the file, I get some leftovers.
I'd appreciate some tips on how I might be able to 'edit' the line of a file without reading the entire file into an array and re-writing it.
I'm using C, not C++.
Standard libraries.
Thanks,
-Rocko
Generally, I'm either read only, or appending to the end of a file. No problems with that.
My latest task is to edit a file.
I have a steam position saved from a previous read operation. I use fsetpos() to position the file pointer for the write. Works great with one exception. It does not delete the line first, so if my new line is shorter than whats already in the file, I get some leftovers.
I'd appreciate some tips on how I might be able to 'edit' the line of a file without reading the entire file into an array and re-writing it.
I'm using C, not C++.
Standard libraries.
Thanks,
-Rocko