Reputation: 14867
It's been a long time since I've had to use this... How can I can truncate the file open with fopen()
at the current file pointer?
I am on Windows if there is no universal solution.
Upvotes: 1
Views: 1544
Reputation: 61138
Since you're on Windows, use this:
_chsize( fileno(f), size);
Or the 64bit version:
_chsize_s(_fileno(f), size);
Upvotes: 3