From 0ad3db110684a565385028ea3a28619c92c14690 Mon Sep 17 00:00:00 2001 From: Corey Farrell Date: Thu, 3 Jan 2019 19:26:10 -0500 Subject: [PATCH] doc: fs.mkdir('/') throws EPERM on Windows Fixes: https://github.com/nodejs/node/issues/25110 --- doc/api/fs.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/doc/api/fs.md b/doc/api/fs.md index 1ab47d17602e00..5535b66c5c6456 100644 --- a/doc/api/fs.md +++ b/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])