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
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).
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 ofaccessSync
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.See: https://nodejs.org/api/fs.html#fs_fs_access_path_mode_callback
The text was updated successfully, but these errors were encountered: