Skip to content

Commit 1d5ba9c

Browse files
Oleksandr-Kushchak-i2MylesBorins
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 <vsemozhetbyt@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
1 parent 226ef71 commit 1d5ba9c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Diff for: doc/api/fs.md

+6
Original file line numberDiff line numberDiff line change
@@ -1546,6 +1546,9 @@ added: v0.0.2
15461546
Asynchronous rmdir(2). No arguments other than a possible exception are given
15471547
to the completion callback.
15481548

1549+
*Note*: Using `fs.rmdir()` on a file (not a directory) results in an `ENOENT`
1550+
error on Windows and an `ENOTDIR` error on POSIX.
1551+
15491552
## fs.rmdirSync(path)
15501553
<!-- YAML
15511554
added: v0.1.21
@@ -1555,6 +1558,9 @@ added: v0.1.21
15551558

15561559
Synchronous rmdir(2). Returns `undefined`.
15571560

1561+
*Note*: Using `fs.rmdirSync()` on a file (not a directory) results in an `ENOENT`
1562+
error on Windows and an `ENOTDIR` error on POSIX.
1563+
15581564
## fs.stat(path, callback)
15591565
<!-- YAML
15601566
added: v0.0.2

0 commit comments

Comments
 (0)