For instance if I called WriteFile to the end of a file, and later I wanted to delete the written bytes, how could I do this? Do I have to read the file’s contents into a buffer, re-create the file, and write the desired bytes, or is there an easier way?
Share
Seek to the file position you want to truncate from (if you’re not already there), then call the aptly-named SetEndOfFile() function.