Hello
I want to read and process and rewrite a very large disk based file
(>3Gbytes) as quickly as possible.
The processing effectively involves finding certain strings and replacing
them with other strings of equal length such that the file size is unaltered
(the file is uncompressed btw). I wondered if anyone could advise me of the
best way to do this and also of things to avoid. More specifically I was
wondering :-
-Is it best to open a single file for read-write access and overwrite the
changed bytes or would it be better to create a new file?
-Is there any point in buffering bytes in rather than reading one byte at a
time or does this just defeat the buffering that's done by the OS anyway?
-Would this benefit from multi-threading - read, process, write?
And finally could anyone point me to any sample code which already does this
sort of thing in the fastest possible way?
Many Thanks
Jeff
I want to read and process and rewrite a very large disk based file
(>3Gbytes) as quickly as possible.
The processing effectively involves finding certain strings and replacing
them with other strings of equal length such that the file size is unaltered
(the file is uncompressed btw). I wondered if anyone could advise me of the
best way to do this and also of things to avoid. More specifically I was
wondering :-
-Is it best to open a single file for read-write access and overwrite the
changed bytes or would it be better to create a new file?
-Is there any point in buffering bytes in rather than reading one byte at a
time or does this just defeat the buffering that's done by the OS anyway?
-Would this benefit from multi-threading - read, process, write?
And finally could anyone point me to any sample code which already does this
sort of thing in the fastest possible way?
Many Thanks
Jeff
Comment