doc: fs.mkdir('/') throws EPERM on Windows
Fixes: https://github.com/nodejs/node/issues/25110 PR-URL: https://github.com/nodejs/node/pull/25340 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ben Coe <bencoe@gmail.com>
This commit is contained in:
parent
398916a821
commit
e7c6f4f68a
@ -2212,6 +2212,15 @@ fs.mkdir('/tmp/a/apple', { recursive: true }, (err) => {
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
On Windows, using `fs.mkdir()` on the root directory even with recursion will
|
||||||
|
result in an error:
|
||||||
|
|
||||||
|
```js
|
||||||
|
fs.mkdir('/', { recursive: true }, (err) => {
|
||||||
|
// => [Error: EPERM: operation not permitted, mkdir 'C:\']
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
See also: mkdir(2).
|
See also: mkdir(2).
|
||||||
|
|
||||||
## fs.mkdirSync(path[, options])
|
## fs.mkdirSync(path[, options])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user