Skip to content

Commit fcc5492

Browse 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 <[email protected]> Reviewed-By: Vse Mozhet Byt <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 5a839b9 commit fcc5492

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

doc/api/fs.md

Lines changed: 5 additions & 5 deletions
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)