From ef6e4f15a08fdc989366a21fc6f37cfc1f445f60 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 bcf4a9f10db8cf..cf83d0de7cc6e0 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -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])