From 41d484264c5f083ac4443fd554da70cb3526cd11 Mon Sep 17 00:00:00 2001 From: Bartosz Sosnowski Date: Thu, 14 Sep 2017 15:02:26 +0200 Subject: [PATCH] doc: document opening hidden files on Windows PR-URL: https://github.com/nodejs/node/pull/15409 Fixes: https://github.com/nodejs/node/issues/14553 Reviewed-By: Colin Ihrig Reviewed-By: Vse Mozhet Byt Reviewed-By: James M Snell Reviewed-By: Ben Noordhuis Reviewed-By: Nikolai Vavilov Reviewed-By: Ruben Bridgewater --- doc/api/fs.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/api/fs.md b/doc/api/fs.md index f1f114b144..6e64319058 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -102,6 +102,11 @@ example `fs.readdirSync('c:\\')` can potentially return a different result than `fs.readdirSync('c:')`. For more information, see [this MSDN page][MSDN-Rel-Path]. +*Note:* On Windows, opening an existing hidden file using the `w` flag (either +through `fs.open` or `fs.writeFile`) will fail with `EPERM`. Existing hidden +files can be opened for writing with the `r+` flag. A call to `fs.ftruncate` can +be used to reset the file contents. + ## Threadpool Usage Note that all file system APIs except `fs.FSWatcher()` and those that are