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: https://github.com/nodejs/node/issues/7110 PR-URL: https://github.com/nodejs/node/pull/7113 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
parent
80f1fbb00f
commit
d976d66cfc
@ -309,18 +309,19 @@ added: v1.0.0
|
|||||||
* `mode` {Integer}
|
* `mode` {Integer}
|
||||||
* `callback` {Function}
|
* `callback` {Function}
|
||||||
|
|
||||||
Tests a user's permissions for the file specified by `path`. `mode` is an
|
Tests a user's permissions for the file or directory specified by `path`.
|
||||||
optional integer that specifies the accessibility checks to be performed. The
|
The `mode` argument is an optional integer that specifies the accessibility
|
||||||
following constants define the possible values of `mode`. It is possible to
|
checks to be performed. The following constants define the possible values of
|
||||||
create a mask consisting of the bitwise OR of two or more values.
|
`mode`. It is possible to create a mask consisting of the bitwise OR of two or
|
||||||
|
more values.
|
||||||
|
|
||||||
- `fs.constants.F_OK` - File is visible to the calling process. This is useful
|
- `fs.constants.F_OK` - `path` is visible to the calling process. This is useful
|
||||||
for determining if a file exists, but says nothing about `rwx` permissions.
|
for determining if a file exists, but says nothing about `rwx` permissions.
|
||||||
Default if no `mode` is specified.
|
Default if no `mode` is specified.
|
||||||
- `fs.constants.R_OK` - File can be read by the calling process.
|
- `fs.constants.R_OK` - `path` can be read by the calling process.
|
||||||
- `fs.constants.W_OK` - File can be written by the calling process.
|
- `fs.constants.W_OK` - `path` can be written by the calling process.
|
||||||
- `fs.constants.X_OK` - File can be executed by the calling process. This has no
|
- `fs.constants.X_OK` - `path` can be executed by the calling process. This has
|
||||||
effect on Windows (will behave like `fs.constants.F_OK`).
|
no effect on Windows (will behave like `fs.constants.F_OK`).
|
||||||
|
|
||||||
The final argument, `callback`, is a callback function that is invoked with
|
The final argument, `callback`, is a callback function that is invoked with
|
||||||
a possible error argument. If any of the accessibility checks fail, the error
|
a possible error argument. If any of the accessibility checks fail, the error
|
||||||
@ -341,7 +342,7 @@ added: v0.1.93
|
|||||||
* `path` {String | Buffer}
|
* `path` {String | Buffer}
|
||||||
* `mode` {Integer}
|
* `mode` {Integer}
|
||||||
|
|
||||||
Synchronous version of [`fs.access()`][]. This throws if any accessibility
|
Synchronous version of [`fs.access()`][]. This throws if any accessibility
|
||||||
checks fail, and does nothing otherwise.
|
checks fail, and does nothing otherwise.
|
||||||
|
|
||||||
## fs.appendFile(file, data[, options], callback)
|
## fs.appendFile(file, data[, options], callback)
|
||||||
@ -503,8 +504,8 @@ the file instead of the entire file. Both `start` and `end` are inclusive and
|
|||||||
start at 0. The `encoding` can be any one of those accepted by [`Buffer`][].
|
start at 0. The `encoding` can be any one of those accepted by [`Buffer`][].
|
||||||
|
|
||||||
If `fd` is specified, `ReadStream` will ignore the `path` argument and will use
|
If `fd` is specified, `ReadStream` will ignore the `path` argument and will use
|
||||||
the specified file descriptor. This means that no `'open'` event will be
|
the specified file descriptor. This means that no `'open'` event will be
|
||||||
emitted. Note that `fd` should be blocking; non-blocking `fd`s should be passed
|
emitted. Note that `fd` should be blocking; non-blocking `fd`s should be passed
|
||||||
to [`net.Socket`][].
|
to [`net.Socket`][].
|
||||||
|
|
||||||
If `autoClose` is false, then the file descriptor won't be closed, even if
|
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()`.
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><code>O_SYMLINK</code></td>
|
<td><code>O_SYMLINK</code></td>
|
||||||
<td>Flag indicating to open the symbolic link itself rather than the
|
<td>Flag indicating to open the symbolic link itself rather than the
|
||||||
resource it is pointing to.</td>
|
resource it is pointing to.</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user