I am looking for a way to make speedy modifications to large multi-gigabyte files. Do the Win32 API support the ability to insert text into a file at a specific offset without having to rewrite the entire file back to disk from the very beginning or from the offset of the change?
Consider an example. Let's say we have the text "test" repeated over and over in a file that is 1 GB in size. If I want to go to the 500 MB offset and insert the text "new", is there a way to insert it without having to rewrite the entire file from the beginning, and/or without having to rewrite the last 500 MBs of it?
Can it be done using Win32 API? If not, are there any strategies to optimize a text insertion operation like this to maximize speed?