Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
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.
  • Loading branch information
joyeecheung committed May 17, 2018
commit 6fa590b2ae7e0b69d80e10da6748985a3e2a72c0
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