Skip to content

Commit 7857e9c

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 402071b commit 7857e9c

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

doc/api/fs.md

+18
Original file line numberDiff line numberDiff line change
@@ -618,6 +618,9 @@ exist. `data` can be a string or a {Buffer}.
618618
619619
If `options` is a string, then it specifies the `encoding`.
620620
621+
The `mode` option only affects the newly created file. See [`fs.open()`][]
622+
for more details.
623+
621624
The `path` may be specified as a {FileHandle} that has been opened
622625
for appending (using `fsPromises.open()`).
623626
@@ -1333,6 +1336,9 @@ The `encoding` option is ignored if `data` is a buffer.
13331336
13341337
If `options` is a string, then it specifies the encoding.
13351338
1339+
The `mode` option only affects the newly created file. See [`fs.open()`][]
1340+
for more details.
1341+
13361342
Any specified {FileHandle} has to support writing.
13371343
13381344
It is unsafe to use `fsPromises.writeFile()` multiple times on the same file
@@ -1599,6 +1605,9 @@ changes:
15991605
Asynchronously append data to a file, creating the file if it does not yet
16001606
exist. `data` can be a string or a {Buffer}.
16011607
1608+
The `mode` option only affects the newly created file. See [`fs.open()`][]
1609+
for more details.
1610+
16021611
```mjs
16031612
import { appendFile } from 'fs';
16041613
@@ -4032,6 +4041,9 @@ a file descriptor.
40324041
40334042
The `encoding` option is ignored if `data` is a buffer.
40344043
4044+
The `mode` option only affects the newly created file. See [`fs.open()`][]
4045+
for more details.
4046+
40354047
If `data` is a plain object, it must have an own (not inherited) `toString`
40364048
function property.
40374049
@@ -4206,6 +4218,9 @@ changes:
42064218
Synchronously append data to a file, creating the file if it does not yet
42074219
exist. `data` can be a string or a {Buffer}.
42084220
4221+
The `mode` option only affects the newly created file. See [`fs.open()`][]
4222+
for more details.
4223+
42094224
```mjs
42104225
import { appendFileSync } from 'fs';
42114226

@@ -5162,6 +5177,9 @@ Returns `undefined`.
51625177
If `data` is a plain object, it must have an own (not inherited) `toString`
51635178
function property.
51645179
5180+
The `mode` option only affects the newly created file. See [`fs.open()`][]
5181+
for more details.
5182+
51655183
For detailed information, see the documentation of the asynchronous version of
51665184
this API: [`fs.writeFile()`][].
51675185

0 commit comments

Comments
 (0)