Possible to delete selected portions of fstream file content?

Hi all,

I'd like to ask a question on the use of fstream.

Let's say that I've opened a binary file for reading using fstream. Is it possible for me to delete portions of the file as it is being read (i.e. remove all of the bytes from byte x to y), while keeping fstream open? If so, how can this be achieved?

Thanks in advance.

Rocky K.
Do you mean you want to remove portions from the file on disk or the copy in memory?

If you mean moving bytes in the file itself around, it's possible, but it's so slow and the code required is so cumbersome that it's not recommendable.
It's far easier to just read the file to memory, do the changes, then write back.
Topic archived. No new replies allowed.