From d09603d4988255a19859866fdb6e76ce0ce50e0a Mon Sep 17 00:00:00 2001 From: Gaelan Date: Tue, 30 Apr 2019 16:12:46 -0700 Subject: [PATCH 1/3] doc: clarify behavior of fs.mkdir --- doc/api/fs.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/doc/api/fs.md b/doc/api/fs.md index 9e3b0df9a487b9..059f06a8a225ed 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -2206,7 +2206,9 @@ are given to the completion callback. The optional `options` argument can be an integer specifying mode (permission and sticky bits), or an object with a `mode` property and a `recursive` -property indicating whether parent folders should be created. +property indicating whether parent folders should be created. Calling `fs.mkdir` +with a path to a directory that exists results in an error an error only +when `recursive` is false. ```js // Creates /tmp/a/apple, regardless of whether `/tmp` and /tmp/a exist. @@ -4288,7 +4290,9 @@ arguments upon success. The optional `options` argument can be an integer specifying mode (permission and sticky bits), or an object with a `mode` property and a `recursive` -property indicating whether parent folders should be created. +property indicating whether parent folders should be created. Calling `fs.mkdir` +with a path to a directory that exists results in an error an error only +when `recursive` is false. ### fsPromises.mkdtemp(prefix[, options])