Conversation
doc/api/fs.md
Outdated
| following is prone to error: | ||
| Note that there is no guaranteed ordering when using asynchronous methods. | ||
| So the following is prone to error because the `fs.stat()` operation may | ||
| completely before the `fs.rename()` operation. |
There was a problem hiding this comment.
Should this be completely -> complete instead?
| * Returns: {boolean} | ||
|
|
||
| Returns `true` if the `fs.Stats` object describes a character device. | ||
| ### stats.isDirectory() |
There was a problem hiding this comment.
Nit: can we add a new line before this for consistency?
| * Returns: {boolean} | ||
|
|
||
| Returns `true` if the `fs.Stats` object describes a file system directory. | ||
| ### stats.isFIFO() |
doc/api/fs.md
Outdated
|
|
||
| * Value: {number} | ||
|
|
||
| The timestamp indicating the last time this files status was changed expressed |
There was a problem hiding this comment.
this files -> the file or this file's
doc/api/fs.md
Outdated
|
|
||
| * Value: {Date} | ||
|
|
||
| The timestamp indicating the last time this files status was changed. |
There was a problem hiding this comment.
this files -> the file or this file's
doc/api/fs.md
Outdated
| The `fs` module provides an API for interacting with the file system in a | ||
| manner closely modeled around standard POSIX functions. | ||
|
|
||
| To use this module, use: |
There was a problem hiding this comment.
A nit: I am not sure, but are these two use a bit monotonous?
doc/api/fs.md
Outdated
| Most `fs` operations accept filepaths that may be specified in the form of | ||
| a string, a [`Buffer`][], or a [`URL`][] object using the `file:` protocol. | ||
|
|
||
| String form paths are interpretted as UTF-8 character sequences identifying |
There was a problem hiding this comment.
interpretted -> interpreted ?
doc/api/fs.md
Outdated
| Example using an absolute path on POSIX: | ||
|
|
||
| ```js | ||
| fs.open(Buffer.from('/open/some/file.txt'), (err, fd) => { |
doc/api/fs.md
Outdated
| operations use these file descriptors to identify and track each specific | ||
| file. Windows systems use a different but conceptually similar mechanism for | ||
| tracking resources. To simplify things for users, Node.js abstracts away the | ||
| specific differences between operating sytems and assigns all open files a |
| object. | ||
|
|
||
| The object itself emits these events: | ||
| All `fs.FSWatcher` objects are [`EventEmitter`][]'s that will emit a `'change'` |
doc/api/fs.md
Outdated
| description: Added times as numbers. | ||
| --> | ||
|
|
||
| An `fs.Stats` object provides information about a file. |
| Returns `true` if the `fs.Stats` object describes a symbolic link. | ||
|
|
||
| *Note*: This method is only valid when using [`fs.lstat()`][] | ||
|
|
There was a problem hiding this comment.
A nit: delete the extra new line?
doc/api/fs.md
Outdated
| `fs.writeFile()`, `fs.readFile()`, etc. | ||
|
|
||
| *Note:* On Windows, opening an existing hidden file using the `w` flag (either | ||
| through `fs.open` or `fs.writeFile`) will fail with `EPERM`. Existing hidden |
There was a problem hiding this comment.
fs.open -> fs.open() ?
fs.writeFile -> fs.writeFile() ?
doc/api/fs.md
Outdated
|
|
||
| *Note:* On Windows, opening an existing hidden file using the `w` flag (either | ||
| through `fs.open` or `fs.writeFile`) will fail with `EPERM`. Existing hidden | ||
| files can be opened for writing with the `r+` flag. A call to `fs.ftruncate` can |
There was a problem hiding this comment.
fs.ftruncate -> fs.ftruncate() ?
doc/api/fs.md
Outdated
| [`URL`]: url.html#url_the_whatwg_url_api | ||
| [`UV_THREADPOOL_SIZE`]: cli.html#cli_uv_threadpool_size_size | ||
| [`WriteStream`]: #fs_class_fs_writestream | ||
| [`EventEmitter']: events.html |
There was a problem hiding this comment.
Erroneous single quote instead of backtick?
PR-URL: #17692 Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
|
Landed in 400e73a |
PR-URL: #17692 Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
PR-URL: #17692 Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
|
Are these changes applicable to 6.x or 8.x? |
Some improvements
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passesAffected core subsystem(s)
fs doc