Skip to content

fs.access docs inconsistency with files/directories #7110

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    fsIssues and PRs related to file-system APIs and the fs module.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions