Skip to content

Commit

Permalink
doc: document file mode caveats on Windows
Browse files Browse the repository at this point in the history
- 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: #20636
Fixes: #20498
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
  • Loading branch information
joyeecheung committed May 17, 2018
1 parent a18e130 commit f9de6f5
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions doc/api/fs.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
<!-- YAML
added: v0.6.7
Expand Down Expand Up @@ -1992,7 +1996,7 @@ changes:
-->

* `path` {string|Buffer|URL}
* `mode` {integer} **Default:** `0o777`
* `mode` {integer} Not supported on Windows. **Default:** `0o777`.
* `callback` {Function}
* `err` {Error}

Expand All @@ -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()`][].
Expand Down Expand Up @@ -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)`.

Expand Down

0 comments on commit f9de6f5

Please sign in to comment.