Neo wrote:
I want to remove 10 bytes from end of the file, how I can perform this
task using C++ filing functions?
I am not want to make new, write contents, remove input file and rename
output file.
In C++ ios::trunc flag available use for truncation but how to use
trunk flag in my task?
ios::trunc, along with ios::out, is the default open mode for a file
opened by an ofstream object. That means when you open a file for
writing, it is truncated to zero, i.e., cleared. So if you want to
truncate 10 bytes off a file...
1. open the file for reading
2. read the contents into a buffer
3. close the file
4. open it for writing
5. write out the buffer except the last 10 bytes.
Kristo