From fcc5492df2d64a5cfefd7a453a5e90f18953260c Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Mon, 30 Apr 2018 21:56:46 -0700 Subject: [PATCH] doc: clarify FileHandle text MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: https://github.com/nodejs/node/pull/20450 Reviewed-By: Luigi Pinca Reviewed-By: Vse Mozhet Byt Reviewed-By: Colin Ihrig Reviewed-By: Tobias Nießen Reviewed-By: Trivikram Kamat Reviewed-By: James M Snell --- doc/api/fs.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/api/fs.md b/doc/api/fs.md index 98b3c0cea26d24..ee541b78e48224 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -3378,11 +3378,11 @@ and will emit a process warning, thereby helping to prevent memory leaks. Instances of the `FileHandle` object are created internally by the `fsPromises.open()` method. -Unlike callback-based such as `fs.fstat()`, `fs.fchown()`, `fs.fchmod()`, -`fs.ftruncate()`, `fs.read()`, and `fs.write()`, operations — all of which -use a simple numeric file descriptor, all `fsPromises.*` variations use the -`FileHandle` class in order to help protect against accidental leaking of -unclosed file descriptors after a `Promise` is resolved or rejected. +Unlike the callback-based API (`fs.fstat()`, `fs.fchown()`, `fs.fchmod()`, and +so on), a numeric file descriptor is not used by the promise-based API. Instead, +the promise-based API uses the `FileHandle` class in order to help avoid +accidental leaking of unclosed file descriptors after a `Promise` is resolved or +rejected. #### filehandle.appendFile(data, options)