From f9de6f580460d01309b5d9e4d980ed37624de1a9 Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Thu, 10 May 2018 01:26:42 +0800 Subject: [PATCH] doc: document file mode caveats on Windows - On Windows only the write permission (read-only bit) can be manipulated, and there is no distinction among owner, group or others. - mkdir on Windows does not support the mode argument. PR-URL: https://github.com/nodejs/node/pull/20636 Fixes: https://github.com/nodejs/node/issues/20498 Reviewed-By: James M Snell Reviewed-By: Anatoli Papirovski --- doc/api/fs.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/doc/api/fs.md b/doc/api/fs.md index b0c1d5fa63d4d8..470601f0b74dd9 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -1089,6 +1089,10 @@ For example, the octal value `0o765` means: * The group may read and write the file. * Others may read and execute the file. +Caveats: on Windows only the write permission can be changed, and the +distinction among the permissions of group, owner or others is not +implemented. + ## fs.chmodSync(path, mode) * `path` {string|Buffer|URL} -* `mode` {integer} **Default:** `0o777` +* `mode` {integer} Not supported on Windows. **Default:** `0o777`. * `callback` {Function} * `err` {Error} @@ -2012,7 +2016,7 @@ changes: --> * `path` {string|Buffer|URL} -* `mode` {integer} **Default:** `0o777` +* `mode` {integer} Not supported on Windows. **Default:** `0o777`. Synchronously creates a directory. Returns `undefined`. This is the synchronous version of [`fs.mkdir()`][]. @@ -2132,7 +2136,8 @@ changes: Asynchronous file open. See open(2). `mode` sets the file mode (permission and sticky bits), but only if the file was -created. +created. Note that on Windows only the write permission can be manipulated, +see [`fs.chmod()`][]. The callback gets two arguments `(err, fd)`.