Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit dedfcb7

Browse filesBrowse files
kibertoadcjihrig
authored andcommitted
doc: clarify fd closing by fs.readFile etc.
Ref: #7560 PR-URL: #7561 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
1 parent c843e58 commit dedfcb7
Copy full SHA for dedfcb7

File tree

Expand file treeCollapse file tree

1 file changed

+6
-3
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+6
-3
lines changed
Open diff view settings
Collapse file

‎doc/api/fs.md‎

Copy file name to clipboardExpand all lines: doc/api/fs.md
+6-3Lines changed: 6 additions & 3 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,8 @@ fs.appendFile('message.txt', 'data to append', 'utf8', callback);
384384

385385
Any specified file descriptor has to have been opened for appending.
386386

387-
_Note: Specified file descriptors will not be closed automatically._
387+
_Note: If a file descriptor is specified as the `file`, it will not be closed
388+
automatically._
388389

389390
## fs.appendFileSync(file, data[, options])
390391
<!-- YAML
@@ -1136,7 +1137,8 @@ fs.readFile('/etc/passwd', 'utf8', callback);
11361137

11371138
Any specified file descriptor has to support reading.
11381139

1139-
_Note: Specified file descriptors will not be closed automatically._
1140+
_Note: If a file descriptor is specified as the `file`, it will not be closed
1141+
automatically._
11401142

11411143
## fs.readFileSync(file[, options])
11421144
<!-- YAML
@@ -1671,7 +1673,8 @@ Note that it is unsafe to use `fs.writeFile` multiple times on the same file
16711673
without waiting for the callback. For this scenario,
16721674
`fs.createWriteStream` is strongly recommended.
16731675

1674-
_Note: Specified file descriptors will not be closed automatically._
1676+
_Note: If a file descriptor is specified as the `file`, it will not be closed
1677+
automatically._
16751678

16761679
## fs.writeFileSync(file, data[, options])
16771680
<!-- YAML

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.