Skip to content

Commit 3abcb69

Browse files
ronagMylesBorins
authored andcommitted
doc: add note about fs.close() about undefined behavior
Add notes to fs.close and fs.closeSync() about udnefined behavior. PR-URL: #30966 Refs: #30864 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 5e268b8 commit 3abcb69

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

doc/api/fs.md

+6
Original file line numberDiff line numberDiff line change
@@ -1533,6 +1533,9 @@ changes:
15331533
Asynchronous close(2). No arguments other than a possible exception are given
15341534
to the completion callback.
15351535

1536+
Calling `fs.close()` on any file descriptor (`fd`) that is currently in use
1537+
through any other `fs` operation may lead to undefined behavior.
1538+
15361539
## fs.closeSync(fd)
15371540
<!-- YAML
15381541
added: v0.1.21
@@ -1542,6 +1545,9 @@ added: v0.1.21
15421545

15431546
Synchronous close(2). Returns `undefined`.
15441547

1548+
Calling `fs.closeSync()` on any file descriptor (`fd`) that is currently in use
1549+
through any other `fs` operation may lead to undefined behavior.
1550+
15451551
## fs.constants
15461552

15471553
* {Object}

0 commit comments

Comments
 (0)