hi

i have some question about file operations, working with vc++ on win2k, console application:

i have a huge text-file (5gb+) and need to change a number on every page. There are several ways I could do this:

1. read an certain amount of data in a buffer, work on a buffer and the fprintf it to a new file. problem: after doing that it fills up 10gb+ of disk space, because there are two files at the time (of course one is deleteted at programm termination, but right befor that...). It could be, that the disk doesn't have that much left (no, i don't have money for a larger disk :-)?
To solve that i could always delete the part of the file i already have in the buffer. but how?

2. i could just insert the new numbers dirctly in the file and remove other numbers. but is that possible and how?). that would save me to copy the file and save a lot of time.

3. i could go over the file and building up a linked list with the file positions, where the stuff to change is and then copy the file till the first position is reached, put my stuff and continiue (after a short overreading). but there's once more the 10gb problem.

i already once wrote a similar (not the same) prog, that copied the file and on the fly changed stuff, but it used to have about 12 hours for a 3gb file and filled up my hd to 6gb. i'm pretty sure one could solve that mor efficient and i want to plan this next prog propperly.

thanks, i apreciate your help.