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 <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ben Coe <bencoe@gmail.com>
  • Loading branch information
coreyfarrell authored and BethGriggs committed May 10, 2019
1 parent 2d9e52d commit 757cf4d
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 @@ -2207,6 +2207,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 757cf4d

Please sign in to comment.