Deleting certain bytes from binary file.

How to delete certain bytes from middle of a binary file?
Those bytes are in fact of a struct.

One approach I found was to re-write the whole data except the struct I want to delete. But may be its not good one if file size is in gb and I will have to write complete data again.

Any suggestion?
WHen dealing with large data structures (databases for example), data usualy does not get deleted, but instead marked as deleted exactly to avoid copy of large amounts of data. Then it will be compresse once a day to actually deleta all data.
Topic archived. No new replies allowed.