Skip to content

Commit c0cf129

Browse files
Oleksandr-Kushchak-i2addaleax
authored andcommitted
docs: add note about fs.rmdir()
fs.rmdir() on the file (not directory) results in different errors on Windows to everything else Fixes: #8797 PR-URL: #14323 Reviewed-By: Vse Mozhet Byt <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]>
1 parent 58afe52 commit c0cf129

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)