Repository navigation
expected behaviour of fs.constants.W_OK #17508
Description
Activity
Documentation PR welcome. For inspiration, check out http://man7.org/linux/man-pages/man2/access.2.html. Of specific interest here:
The mode specifies the accessibility check(s) to be performed, and is either the value F_OK, or a mask consisting of the bitwise OR of one or more of R_OK, W_OK, and X_OK. F_OK tests for the existence of the file. R_OK, W_OK, and X_OK test whether the file exists and grants read, write, and execute permissions, respectively.
upon further reading, I believe the issue I'm facing is due checking whether the file path is writable, instead of checking if the file's directory is writable.
in that context, technically the docs are correct, however, some examples would help.
I'll take a stab at improving the examples
I'm going to reopen this, because I agree that those docs could be improved. If you or anyone else makes a PR for the docs, then we can close this.
- addedfsIssues and PRs related to file-system APIs and the fs module.Issues and PRs related to file-system APIs and the fs module.
on Dec 7, 2017 Hi, I've tried improving the documentation of fs.access, take a look at my pull request #17578.
Thanks
- addedgood first issueIssues that are suitable for first-time contributors.Issues that are suitable for first-time contributors.
on Apr 28, 2018 #17578 was never landed but has enough content in for a first timer to pick and progress.
Hi
@ gireeshpunathil(edited the comment to say hi to all previous commenters, or issue viewers instead 😅), would you mind if I pick up this first timer? I can work off the content of #17578 and give it a "spin".Reacted by Gireesh Punathilsure, please go ahead.
Reacted by Benjamin Chen- added 2 commits that reference this issue
on May 4, 2018 - added a commit that references this issue
on Jul 27, 2026
7.x,8.x,9.xaccording to the documentation:
the description text reads as agnostic to the behaviour of the
pathexisting or not, however in practice, this only works if thepathexists:results in:
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.