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 MylesBorins committed May 16, 2019
1 parent 81cf2b4 commit ef6e4f1
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 ef6e4f1

Please sign in to comment.