Skip to content

Commit 6489a41

Browse files
docs: add note about fs.rmdir()
fs.rmdir() on the file (not directory) results in different errors on Windows to everything else fixes: #8797
1 parent e0340af commit 6489a41

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
@@ -2004,6 +2004,9 @@ changes:
20042004
Asynchronous rmdir(2). No arguments other than a possible exception are given
20052005
to the completion callback.
20062006

2007+
*Note*: Using `fs.rmdir()` on a file (not a directory) results in an `ENOENT`
2008+
error on Windows and an `ENOTDIR` error on POSIX.
2009+
20072010
## fs.rmdirSync(path)
20082011
<!-- YAML
20092012
added: v0.1.21
@@ -2018,6 +2021,9 @@ changes:
20182021

20192022
Synchronous rmdir(2). Returns `undefined`.
20202023

2024+
*Note*: Using `fs.rmdirSync()` on a file (not a directory) results in an `ENOENT`
2025+
error on Windows and an `ENOTDIR` error on POSIX.
2026+
20212027
## fs.stat(path, callback)
20222028
<!-- YAML
20232029
added: v0.0.2

0 commit comments

Comments
 (0)