Skip to content

Commit 9fdb726

Browse files
rayw000jasnell
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 c68faa9 commit 9fdb726

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
@@ -664,6 +664,9 @@ exist. `data` can be a string or a {Buffer}.
664664
665665
If `options` is a string, then it specifies the `encoding`.
666666
667+
The `mode` option only affects the newly created file. See [`fs.open()`][]
668+
for more details.
669+
667670
The `path` may be specified as a {FileHandle} that has been opened
668671
for appending (using `fsPromises.open()`).
669672
@@ -1379,6 +1382,9 @@ The `encoding` option is ignored if `data` is a buffer.
13791382
13801383
If `options` is a string, then it specifies the encoding.
13811384
1385+
The `mode` option only affects the newly created file. See [`fs.open()`][]
1386+
for more details.
1387+
13821388
Any specified {FileHandle} has to support writing.
13831389
13841390
It is unsafe to use `fsPromises.writeFile()` multiple times on the same file
@@ -1645,6 +1651,9 @@ changes:
16451651
Asynchronously append data to a file, creating the file if it does not yet
16461652
exist. `data` can be a string or a {Buffer}.
16471653
1654+
The `mode` option only affects the newly created file. See [`fs.open()`][]
1655+
for more details.
1656+
16481657
```mjs
16491658
import { appendFile } from 'fs';
16501659
@@ -4086,6 +4095,9 @@ a file descriptor.
40864095
40874096
The `encoding` option is ignored if `data` is a buffer.
40884097
4098+
The `mode` option only affects the newly created file. See [`fs.open()`][]
4099+
for more details.
4100+
40894101
If `data` is a plain object, it must have an own (not inherited) `toString`
40904102
function property.
40914103
@@ -4260,6 +4272,9 @@ changes:
42604272
Synchronously append data to a file, creating the file if it does not yet
42614273
exist. `data` can be a string or a {Buffer}.
42624274
4275+
The `mode` option only affects the newly created file. See [`fs.open()`][]
4276+
for more details.
4277+
42634278
```mjs
42644279
import { appendFileSync } from 'fs';
42654280

@@ -5216,6 +5231,9 @@ Returns `undefined`.
52165231
If `data` is a plain object, it must have an own (not inherited) `toString`
52175232
function property.
52185233
5234+
The `mode` option only affects the newly created file. See [`fs.open()`][]
5235+
for more details.
5236+
52195237
For detailed information, see the documentation of the asynchronous version of
52205238
this API: [`fs.writeFile()`][].
52215239

0 commit comments

Comments
 (0)