79078490

Date: 2024-10-11 13:51:53
Score: 0.5
Natty:
Report link

In Windows if you just want to truncate the file after you've finished writing then SetEndOfFile() is the way to go for a HANDLE. If you are working with an fd then SetEndOfFile((HANDLE) _get_osfhandle(fd)). _chsize() or _ftruncate() may only support 32 bit arguments on 32 bit compilers. In Unix AFAIK there isn't any "no size" function like SetEndOfFile().

Reasons:
  • Has code block (-0.5):
  • Single line (0.5):
  • Low reputation (0.5):
Posted by: Renate