Skip to content

Commit d976d66

Browse files
lancejasnell
authored andcommitted
doc: clarify fs.access works on directories too.
This is maybe more verbose than needed, since the same information is repeated several times. An alternative, maybe a single short sentence at the beginning is better. E.g. Fixes: #7110 PR-URL: #7113 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 80f1fbb commit d976d66

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

doc/api/fs.md

+14-13
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.
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.
316317

317-
- `fs.constants.F_OK` - File is visible to the calling process. This is useful
318+
- `fs.constants.F_OK` - `path` is visible to the calling process. This is useful
318319
for determining if a file exists, but says nothing about `rwx` permissions.
319320
Default if no `mode` is specified.
320-
- `fs.constants.R_OK` - File can be read by the calling process.
321-
- `fs.constants.W_OK` - File can be written by the calling process.
322-
- `fs.constants.X_OK` - File can be executed by the calling process. This has no
323-
effect on Windows (will behave like `fs.constants.F_OK`).
321+
- `fs.constants.R_OK` - `path` can be read by the calling process.
322+
- `fs.constants.W_OK` - `path` can be written by the calling process.
323+
- `fs.constants.X_OK` - `path` can be executed by the calling process. This has
324+
no effect on Windows (will behave like `fs.constants.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
@@ -341,7 +342,7 @@ added: v0.1.93
341342
* `path` {String | Buffer}
342343
* `mode` {Integer}
343344

344-
Synchronous version of [`fs.access()`][]. This throws if any accessibility
345+
Synchronous version of [`fs.access()`][]. This throws if any accessibility
345346
checks fail, and does nothing otherwise.
346347

347348
## fs.appendFile(file, data[, options], callback)
@@ -503,8 +504,8 @@ the file instead of the entire file. Both `start` and `end` are inclusive and
503504
start at 0. The `encoding` can be any one of those accepted by [`Buffer`][].
504505

505506
If `fd` is specified, `ReadStream` will ignore the `path` argument and will use
506-
the specified file descriptor. This means that no `'open'` event will be
507-
emitted. Note that `fd` should be blocking; non-blocking `fd`s should be passed
507+
the specified file descriptor. This means that no `'open'` event will be
508+
emitted. Note that `fd` should be blocking; non-blocking `fd`s should be passed
508509
to [`net.Socket`][].
509510

510511
If `autoClose` is false, then the file descriptor won't be closed, even if
@@ -1802,7 +1803,7 @@ The following constants are meant for use with `fs.open()`.
18021803
</tr>
18031804
<tr>
18041805
<td><code>O_SYMLINK</code></td>
1805-
<td>Flag indicating to open the symbolic link itself rather than the
1806+
<td>Flag indicating to open the symbolic link itself rather than the
18061807
resource it is pointing to.</td>
18071808
</tr>
18081809
<tr>

0 commit comments

Comments
 (0)