Mar 3, 2009, 11:09 AM
Post #1 of 2
Suppose I have a large file, and I want to delete selected bytes from it by providing offsets. For example, delete the 455227th, 564649th, and 6262545th bytes from a 2 gig file.
delete nth byte from a file
Only way I can think of is ugly: copy the file byte-by-byte to a temp file, counting bytes and skipping the ones I want to delete.
Is there an elegant, in-place way to do this?