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 fcc5492

Browse filesBrowse files
TrottMylesBorins
authored andcommitted
doc: clarify FileHandle text
There is a paragraph about why the promise-based API uses `FileHandle` rather than a numeric `fd`. Unfortunately, the paragraph is a bit of word-salad. Edit it for clarity, grammar, and style. PR-URL: #20450 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 5a839b9 commit fcc5492
Copy full SHA for fcc5492

File tree

Expand file treeCollapse file tree

1 file changed

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

1 file changed

+5
-5
lines changed
Open diff view settings
Collapse file

‎doc/api/fs.md‎

Copy file name to clipboardExpand all lines: doc/api/fs.md
+5-5Lines changed: 5 additions & 5 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -3378,11 +3378,11 @@ and will emit a process warning, thereby helping to prevent memory leaks.
33783378
Instances of the `FileHandle` object are created internally by the
33793379
`fsPromises.open()` method.
33803380

3381-
Unlike callback-based such as `fs.fstat()`, `fs.fchown()`, `fs.fchmod()`,
3382-
`fs.ftruncate()`, `fs.read()`, and `fs.write()`, operations — all of which
3383-
use a simple numeric file descriptor, all `fsPromises.*` variations use the
3384-
`FileHandle` class in order to help protect against accidental leaking of
3385-
unclosed file descriptors after a `Promise` is resolved or rejected.
3381+
Unlike the callback-based API (`fs.fstat()`, `fs.fchown()`, `fs.fchmod()`, and
3382+
so on), a numeric file descriptor is not used by the promise-based API. Instead,
3383+
the promise-based API uses the `FileHandle` class in order to help avoid
3384+
accidental leaking of unclosed file descriptors after a `Promise` is resolved or
3385+
rejected.
33863386

33873387
#### filehandle.appendFile(data, options)
33883388
<!-- YAML

0 commit comments

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