From 42ccf22fb7a0918dbcb79435eafa85669ee4b36b Mon Sep 17 00:00:00 2001 From: Robert Nagy Date: Sat, 14 Dec 2019 20:47:01 +0100 Subject: [PATCH] doc: add note about fs.close() about undefined behavior Add notes to fs.close and fs.closeSync() about udnefined behavior. PR-URL: https://github.com/nodejs/node/pull/30966 Refs: https://github.com/nodejs/node/issues/30864 Reviewed-By: Anna Henningsen Reviewed-By: Rich Trott Reviewed-By: Ruben Bridgewater Reviewed-By: Luigi Pinca Reviewed-By: James M Snell --- doc/api/fs.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/doc/api/fs.md b/doc/api/fs.md index 3768f0309ffff1..a45e171e352dbb 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -1533,6 +1533,9 @@ changes: Asynchronous close(2). No arguments other than a possible exception are given to the completion callback. +Calling `fs.close()` on any file descriptor (`fd`) that is currently in use +through any other `fs` operation may lead to undefined behavior. + ## `fs.closeSync(fd)`