You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Windows: ftruncate to shrink file gives EPERM #3177
/cc @nodejs/platform-windows - I don't know the answer to this question. I thought that as long as you have the appropriate privileges and the file is opened for writing (not appending), you should be able to truncate it in either direction.
This behaviour is undocumented in node, and I'd welcome a PR for that, but node doesn't reduce Windows and Unixen to a "lowest common denominator", there are differences.
Activity
bnoordhuis commentedon Oct 5, 2015
/cc @nodejs/platform-windows - I don't know the answer to this question. I thought that as long as you have the appropriate privileges and the file is opened for writing (not appending), you should be able to truncate it in either direction.
jorangreef commentedon Oct 5, 2015
Thanks Ben, that was the problem. I had the file opened on Windows using "a+".
On Mac however, ftruncate still works if the file is opened with "a+".
sam-github commentedon Oct 8, 2015
This behaviour is undocumented in node, and I'd welcome a PR for that, but node doesn't reduce Windows and Unixen to a "lowest common denominator", there are differences.