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:
Corey Farrell 2019-01-03 19:26:10 -05:00 committed by Benjamin
parent 398916a821
commit e7c6f4f68a
No known key found for this signature in database
GPG Key ID: 60AB1C1D478E1286

View File

@ -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).
## fs.mkdirSync(path[, options])