You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fs.access docs inconsistency with files/directories #7110
The docs say: fs.R_OK - File can be read by the calling process.
However, fs.accessSync('path/to/directory', fs.R_OK) will succeed if the path maps to a directory instead of a file. I don't know if this is the expected behavior of accessSync but at least there should be a clarification in the documentation. Currently the documentation reads like it would succeed only for files and not for directories.
Presumably, that's the intent for all modes, correct?
fs.F_OK - File is visible to the calling process. This is useful for determining if a file exists, but says nothing about rwx permissions. Default if no mode is specified.
fs.R_OK - File can be read by the calling process.
fs.W_OK - File can be written by the calling process.
fs.X_OK - File can be executed by the calling process. This has no effect on Windows (will behave like fs.F_OK).
Activity
cjihrig commentedon Jun 2, 2016
Documentation PRs are welcome :-)
cpojer commentedon Jun 2, 2016
It makes sense first to figure out whether the intent of access is to work on directories and files the same.
cjihrig commentedon Jun 2, 2016
The intent is to work the same.
lance commentedon Jun 2, 2016
Presumably, that's the intent for all modes, correct?
doc: clarify fs.access works on directories too.