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
jorangreef opened this issue
Oct 5, 2015
· 3 comments
Labels
docIssues and PRs related to the documentations.fsIssues and PRs related to the fs subsystem / file system.questionIssues that look for answers.windowsIssues and PRs related to the Windows platform.
/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.
bnoordhuis
added
question
Issues that look for answers.
fs
Issues and PRs related to the fs subsystem / file system.
windows
Issues and PRs related to the Windows platform.
labels
Oct 5, 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.
docIssues and PRs related to the documentations.fsIssues and PRs related to the fs subsystem / file system.questionIssues that look for answers.windowsIssues and PRs related to the Windows platform.
I have a file with the following stats in a Windows VM:
{"dev":-24039965,"mode":33206,"nlink":1,"uid":0,"gid":0,"rdev":0,"ino":562949953548321,"size":39035842,"atime":"2015-10-03T09:59:32.677Z","mtime":"2015-10-03T10:00:17.241Z","ctime":"2015-10-03T10:00:17.241Z","birthtime":"2015-10-03T09:59:32.677Z"}
Truncating this file using ftruncate from 39035842 to 38839234 byte (to make it smaller) gives EPERM.
Is ftruncate simply not supported at all on Windows? I thought it was only ftruncate to enlarge a file that was not permitted on Windows?
The text was updated successfully, but these errors were encountered: