Skip to content

Commit f8dcbba

Browse files
coreyfarrelladdaleax
authored andcommitted
doc: fs.mkdir('/') throws EPERM on Windows
Fixes: #25110 PR-URL: #25340 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Ben Coe <[email protected]>
1 parent 1d49408 commit f8dcbba

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
@@ -2212,6 +2212,15 @@ fs.mkdir('/tmp/a/apple', { recursive: true }, (err) => {
22122212
});
22132213
```
22142214

2215+
On Windows, using `fs.mkdir()` on the root directory even with recursion will
2216+
result in an error:
2217+
2218+
```js
2219+
fs.mkdir('/', { recursive: true }, (err) => {
2220+
// => [Error: EPERM: operation not permitted, mkdir 'C:\']
2221+
});
2222+
```
2223+
22152224
See also: mkdir(2).
22162225

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

0 commit comments

Comments
 (0)