Skip to content

Commit 42ccf22

Browse files
ronagtargos
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 <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent d676c6c commit 42ccf22

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)