-
-
Notifications
You must be signed in to change notification settings - Fork 33.1k
Closed
Closed
Copy link
Labels
fsIssues and PRs related to the fs subsystem / file system.Issues and PRs related to the fs subsystem / file system.libuvIssues and PRs related to the libuv dependency or the uv binding.Issues and PRs related to the libuv dependency or the uv binding.
Description
- Version: 8.8.1
- Platform: tested on these systems
Linux peter-XPS-15 4.13.0-16-generic #19-Ubuntu SMP Wed Oct 11 18:35:14 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
- Windows 10 64bit (version 1709)
- Subsystem: fs
Attempting to write to a read-only file will result in:
- an
EACCES
error on Linux systems - an
EPERM
error on Windows systems
Is this expected behavior? If so, it should be documented as such. The only mention of EPERM
is with relation to hidden files.
You can reproduce this by executing the following snippet on machines of the two different platforms.
const fs = require('fs');
const path = require('path');
const code = '444';
const filename = '00000';
const content = 'abcdefghijklmnopqrstuvwxyz';
const filePath = path.join(__dirname, filename);
// set up a read-only file
fs.writeFileSync(filePath, content);
fs.chmodSync(filePath, '444');
fs.writeFile(filePath, content, function (err) {
throw err;
});
https://gist.github.com/pitaj/047faae18463835a8b7697e2964a341e
Metadata
Metadata
Assignees
Labels
fsIssues and PRs related to the fs subsystem / file system.Issues and PRs related to the fs subsystem / file system.libuvIssues and PRs related to the libuv dependency or the uv binding.Issues and PRs related to the libuv dependency or the uv binding.