diff --git a/doc/api/fs.md b/doc/api/fs.md index 3bef99cafc0a15..86d0c4222760f9 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -704,7 +704,7 @@ changes: * Returns: {Promise} Asynchronously writes data to a file, replacing the file if it already exists. -`data` can be a string, a buffer, an {AsyncIterable} or {Iterable} object. +`data` can be a string, a buffer, an {AsyncIterable}, or an {Iterable} object. The promise is resolved with no arguments upon success. If `options` is a string, then it specifies the `encoding`. @@ -1684,7 +1684,7 @@ access(file, constants.R_OK | constants.W_OK, (err) => { ``` Do not use `fs.access()` to check for the accessibility of a file before calling -`fs.open()`, `fs.readFile()` or `fs.writeFile()`. Doing +`fs.open()`, `fs.readFile()`, or `fs.writeFile()`. Doing so introduces a race condition, since other processes may change the file's state between the two calls. Instead, user code should open/read/write the file directly and handle the error raised if the file is not accessible. @@ -2409,7 +2409,7 @@ has only one boolean parameter. This is one reason `fs.access()` is recommended instead of `fs.exists()`. Using `fs.exists()` to check for the existence of a file before calling -`fs.open()`, `fs.readFile()` or `fs.writeFile()` is not recommended. Doing +`fs.open()`, `fs.readFile()`, or `fs.writeFile()` is not recommended. Doing so introduces a race condition, since other processes may change the file's state between the two calls. Instead, user code should open/read/write the file directly and handle the error raised if the file does not exist. @@ -3873,7 +3873,7 @@ Asynchronous stat(2). The callback gets two arguments `(err, stats)` where In case of an error, the `err.code` will be one of [Common System Errors][]. Using `fs.stat()` to check for the existence of a file before calling -`fs.open()`, `fs.readFile()` or `fs.writeFile()` is not recommended. +`fs.open()`, `fs.readFile()`, or `fs.writeFile()` is not recommended. Instead, user code should open/read/write the file directly and handle the error raised if the file is not available. @@ -6363,7 +6363,7 @@ changes: A {fs.Stats} object provides information about a file. -Objects returned from [`fs.stat()`][], [`fs.lstat()`][] and [`fs.fstat()`][] and +Objects returned from [`fs.stat()`][], [`fs.lstat()`][], [`fs.fstat()`][], and their synchronous counterparts are of this type. If `bigint` in the `options` passed to those methods is true, the numeric values will be `bigint` instead of `number`, and the object will contain additional @@ -7521,7 +7521,7 @@ fs.open('', 'a+', (err, fd) => { ``` On Windows, opening an existing hidden file using the `'w'` flag (either -through `fs.open()` or `fs.writeFile()` or `fsPromises.open()`) will fail with +through `fs.open()`, `fs.writeFile()`, or `fsPromises.open()`) will fail with `EPERM`. Existing hidden files can be opened for writing with the `'r+'` flag. A call to `fs.ftruncate()` or `filehandle.truncate()` can be used to reset