Skip to content

Commit d0d731e

Browse files
rayw000targos
authored andcommitted
doc: add descriptions about when options.mode is ignored
PR-URL: #39881 Fixes: #39859 Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Darshan Sen <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anto Aravinth <[email protected]>
1 parent 898db5a commit d0d731e

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

doc/api/fs.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -613,6 +613,9 @@ exist. `data` can be a string or a {Buffer}.
613613
614614
If `options` is a string, then it specifies the `encoding`.
615615
616+
The `mode` option only affects the newly created file. See [`fs.open()`][]
617+
for more details.
618+
616619
The `path` may be specified as a {FileHandle} that has been opened
617620
for appending (using `fsPromises.open()`).
618621
@@ -1283,6 +1286,9 @@ The `encoding` option is ignored if `data` is a buffer.
12831286
12841287
If `options` is a string, then it specifies the encoding.
12851288
1289+
The `mode` option only affects the newly created file. See [`fs.open()`][]
1290+
for more details.
1291+
12861292
Any specified {FileHandle} has to support writing.
12871293
12881294
It is unsafe to use `fsPromises.writeFile()` multiple times on the same file
@@ -1548,6 +1554,9 @@ changes:
15481554
Asynchronously append data to a file, creating the file if it does not yet
15491555
exist. `data` can be a string or a {Buffer}.
15501556
1557+
The `mode` option only affects the newly created file. See [`fs.open()`][]
1558+
for more details.
1559+
15511560
```mjs
15521561
import { appendFile } from 'fs';
15531562
@@ -3915,6 +3924,9 @@ a file descriptor.
39153924
39163925
The `encoding` option is ignored if `data` is a buffer.
39173926
3927+
The `mode` option only affects the newly created file. See [`fs.open()`][]
3928+
for more details.
3929+
39183930
If `data` is a plain object, it must have an own (not inherited) `toString`
39193931
function property.
39203932
@@ -4086,6 +4098,9 @@ changes:
40864098
Synchronously append data to a file, creating the file if it does not yet
40874099
exist. `data` can be a string or a {Buffer}.
40884100
4101+
The `mode` option only affects the newly created file. See [`fs.open()`][]
4102+
for more details.
4103+
40894104
```mjs
40904105
import { appendFileSync } from 'fs';
40914106

@@ -4999,6 +5014,9 @@ Returns `undefined`.
49995014
If `data` is a plain object, it must have an own (not inherited) `toString`
50005015
function property.
50015016
5017+
The `mode` option only affects the newly created file. See [`fs.open()`][]
5018+
for more details.
5019+
50025020
For detailed information, see the documentation of the asynchronous version of
50035021
this API: [`fs.writeFile()`][].
50045022

0 commit comments

Comments
 (0)