Natevw wrote:
> I am using <fstream> to write files in binary mode.
> Is there any way I can force the file to end at a certain offset, without
> rewriting the whole file? I could open the file with ios::trunc, but then I
> have to copy into memory or tempfile everything I want to keep. I just want
> to truncate everything after the write pointer. Can this be done?
Not using standard means, I'm afraid. Your OS probably has some mechanism
to do what you want. For example, on UNIX, e.g., there is the 'truncate'
function...
V
|