From 2aa197b0ea72be18af11bfb0df9ab3e4f6e720fd 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 PR-URL: https://github.com/nodejs/node/pull/25340 Reviewed-By: Rich Trott Reviewed-By: Luigi Pinca Reviewed-By: Ben Coe --- 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])