From 3e7b3e3c18cd033e71b0d7204eb53e1c627cbabf Mon Sep 17 00:00:00 2001 From: Bryan English Date: Mon, 6 Jan 2020 22:21:54 -0500 Subject: [PATCH] doc: correct filehandle.[read|write|append]File() * Remove `mode` and `flag` options for all three functions, since they all ignore those options. * Remove mention of `path` argument for `readFile`, since it isn't actually an option to this method. * Clarify that for file handles, `appendFile` and `writeFile` are equivalent. PR-URL: https://github.com/nodejs/node/pull/31235 Reviewed-By: Rich Trott Reviewed-By: Anto Aravinth --- doc/api/fs.md | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/doc/api/fs.md b/doc/api/fs.md index eb92c7f0b3b2e4..a363822bbf952d 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -4253,17 +4253,13 @@ added: v10.0.0 * `data` {string|Buffer} * `options` {Object|string} * `encoding` {string|null} **Default:** `'utf8'` - * `mode` {integer} **Default:** `0o666` - * `flag` {string} See [support of file system `flags`][]. **Default:** `'a'`. * Returns: {Promise} -Asynchronously append data to this file, creating the file if it does not yet -exist. `data` can be a string or a [`Buffer`][]. The `Promise` will be -resolved with no arguments upon success. +Alias of [`filehandle.writeFile()`][]. -If `options` is a string, then it specifies the encoding. - -The `FileHandle` must have been opened for appending. +When operating on file handles, the mode cannot be changed from what it was set +to with [`fsPromises.open()`][]. Therefore, this is equivalent to +[`filehandle.writeFile()`][]. #### `filehandle.chmod(mode)`