Rewrite just where it has changed

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi

I have a very big .txt file, about 17MB, and my application need to read it and make changes at any time

I can put it in a variable and my program writes the file again oly in the end of the program, them it won't nedd to rewrite the file everytime it makes a change. But it uses many space in the memory, and could slow down the system

I was thinks about a way just to write the fiel where is has changed, them it won't write all the file again, so it will be much faster..

If someone has any ideas it could be very helpfull

Thanks in advance.
 
Opening a file, seeking, writing, and closing a file every time there is
a change has the potential of being much more inneficient than writing to
memory.

If you were talking about gigabytes, then you might need to come up with
something as you described, with some kind of advanced paging, indexing, and
fast seeking. Pretty complicated stuff. But for just a few megs, you are
going to see your best results by following the archetype:

1) Load file into memory
2) Use memory as your working set
3) Flush memory back to file

Erik

ltt19 said:
Hi,

I have a very big .txt file, about 17MB, and my application need to read
it and make changes at any time.
I can put it in a variable and my program writes the file again oly in the
end of the program, them it won't nedd to rewrite the file everytime it
makes a change. But it uses many space in the memory, and could slow down
the system.
I was thinks about a way just to write the fiel where is has changed, them
it won't write all the file again, so it will be much faster...
 
Back
Top