Skip to content

Commit

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

PR-URL: nodejs#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 refack committed Jan 10, 2019
1 parent 734e482 commit 2aa197b
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 2aa197b

Please sign in to comment.