Skip to content
Permalink
Browse files

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>
  • Loading branch information...
coreyfarrell authored and addaleax committed Jan 4, 2019
1 parent 1d49408 commit f8dcbba5636e1525609a2fce34a98dbb2138fea2
Showing with 9 additions and 0 deletions.
  1. +9 −0 doc/api/fs.md
@@ -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])

0 comments on commit f8dcbba

Please sign in to comment.
You can’t perform that action at this time.