From a5c571424ac9009203126b8e2c9ed51ae26dbf7d 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 Backport-PR-URL: https://github.com/nodejs/node/pull/21172 --- 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 c2daa8d71a5055..af06bf91e5b5f5 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} @@ -2007,7 +2011,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()`][]. @@ -2127,7 +2131,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)`.