Skip to content

Commit

Permalink
doc: fs.mkdir('/') throws EPERM on Windows
Browse files Browse the repository at this point in the history
Fixes: #25110

PR-URL: #25340
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Ben Coe <[email protected]>
  • Loading branch information
coreyfarrell authored and addaleax committed Jan 8, 2019
1 parent 1d49408 commit f8dcbba
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions doc/api/fs.md
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down

0 comments on commit f8dcbba

Please sign in to comment.