Skip to content

Commit 1e7a7be

Browse files
lancejasnell
authored andcommitted
doc: clarify fs.access works on directories too.
Cherry picked from d976d66 PR-URL: #7321 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
1 parent e814416 commit 1e7a7be

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

doc/api/fs.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -309,18 +309,19 @@ added: v1.0.0
309309
* `mode` {Integer}
310310
* `callback` {Function}
311311

312-
Tests a user's permissions for the file specified by `path`. `mode` is an
313-
optional integer that specifies the accessibility checks to be performed. The
314-
following constants define the possible values of `mode`. It is possible to
315-
create a mask consisting of the bitwise OR of two or more values.
316-
317-
- `fs.F_OK` - File is visible to the calling process. This is useful for
318-
determining if a file exists, but says nothing about `rwx` permissions.
312+
Tests a user's permissions for the file or directory specified by `path`.
313+
The `mode` argument is an optional integer that specifies the accessibility
314+
checks to be performed. The following constants define the possible values of
315+
`mode`. It is possible to create a mask consisting of the bitwise OR of two or
316+
more values.
317+
318+
- `fs.F_OK` - `path` is visible to the calling process. This is useful
319+
for determining if a file exists, but says nothing about `rwx` permissions.
319320
Default if no `mode` is specified.
320-
- `fs.R_OK` - File can be read by the calling process.
321-
- `fs.W_OK` - File can be written by the calling process.
322-
- `fs.X_OK` - File can be executed by the calling process. This has no effect
323-
on Windows (will behave like `fs.F_OK`).
321+
- `fs.R_OK` - `path` can be read by the calling process.
322+
- `fs.W_OK` - `path` can be written by the calling process.
323+
- `fs.X_OK` - `path` can be executed by the calling process. This has
324+
no effect on Windows (will behave like `fs.F_OK`).
324325

325326
The final argument, `callback`, is a callback function that is invoked with
326327
a possible error argument. If any of the accessibility checks fail, the error

0 commit comments

Comments
 (0)