Skip to content

fs.access docs inconsistency with files/directories #7110

Closed
@cpojer

Description

@cpojer
  • Version: 6

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.

See: https://nodejs.org/api/fs.html#fs_fs_access_path_mode_callback

Metadata

Metadata

Assignees

No one assigned

    Labels

    fsIssues and PRs related to the fs subsystem / file system.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions