Skip to content

Commit 6538d92

Browse files
committed
docs(chmod): briefly mention Windows file perms
File permissions on Windows are weird. This adds a brief note into the README that this is something to watch out for. As far as I'm aware, WSL completely avoids the weirdness because it's actually Linux (and so it follows POSIX).
1 parent b4daff5 commit 6538d92

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,10 @@ Notable exceptions:
187187
+ In symbolic modes, `a-r` and `-r` are identical. No consideration is
188188
given to the `umask`.
189189
+ There is no "quiet" option, since default behavior is to run silent.
190+
+ Windows OS uses a very different permission model than POSIX. `chmod()`
191+
does its best on Windows, but there are limits to how file permissions can
192+
be set. Note that WSL (Windows subsystem for Linux) **does** follow POSIX,
193+
so cross-platform compatibility should not be a concern there.
190194

191195
Returns a [ShellString](#shellstringstr) indicating success or failure.
192196

src/chmod.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ common.register('chmod', _chmod, {
5959
//@ + In symbolic modes, `a-r` and `-r` are identical. No consideration is
6060
//@ given to the `umask`.
6161
//@ + There is no "quiet" option, since default behavior is to run silent.
62+
//@ + Windows OS uses a very different permission model than POSIX. `chmod()`
63+
//@ does its best on Windows, but there are limits to how file permissions can
64+
//@ be set. Note that WSL (Windows subsystem for Linux) **does** follow POSIX,
65+
//@ so cross-platform compatibility should not be a concern there.
6266
//@
6367
//@ Returns a [ShellString](#shellstringstr) indicating success or failure.
6468
function _chmod(options, mode, filePattern) {

0 commit comments

Comments
 (0)