Skip to content

expected behaviour of fs.constants.W_OK #17508

Description

@ahmadnassri
  • Version: tested on 7.x, 8.x, 9.x

according to the documentation:

fs.constants.W_OK - path can be written by the calling process

the description text reads as agnostic to the behaviour of the path existing or not, however in practice, this only works if the path exists:

const fs = require('fs')

fs.access('my-test-file', fs.constants.W_OK, console.log)

results in:

{ Error: ENOENT: no such file or directory, access 'my-test-file'  errno: -2,  code: 'ENOENT',  syscall: 'access',  path: 'my-test-file' }

I am not certain if the intended functionality is what's accurately described, meaning this is a technical bug, or if the description is lacking in clarity.

Happy to help address either through PR, I believe this is a documentation problem, so wanted to be sure before.

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.good first issueIssues that are suitable for first-time contributors.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions