Skip to content

Commit ef6e4f1

Browse files
coreyfarrellMylesBorins
authored andcommitted
doc: fs.mkdir('/') throws EPERM on Windows
Fixes: #25110 PR-URL: #25340 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ben Coe <bencoe@gmail.com>
1 parent 81cf2b4 commit ef6e4f1

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

doc/api/fs.md

+9
Original file line numberDiff line numberDiff line change
@@ -2207,6 +2207,15 @@ fs.mkdir('/tmp/a/apple', { recursive: true }, (err) => {
22072207
});
22082208
```
22092209

2210+
On Windows, using `fs.mkdir()` on the root directory even with recursion will
2211+
result in an error:
2212+
2213+
```js
2214+
fs.mkdir('/', { recursive: true }, (err) => {
2215+
// => [Error: EPERM: operation not permitted, mkdir 'C:\']
2216+
});
2217+
```
2218+
22102219
See also: mkdir(2).
22112220

22122221
## fs.mkdirSync(path[, options])

0 commit comments

Comments
 (0)