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 authored and Anna Henningsen committed 2019-01-09 00:50:44 +01:00
1 parent 1d4940888d
commit f8dcbba563
1 file changed
+9
+9
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])