Skip to content

Commit 8b4f122

Browse files
bzozMylesBorins
authored andcommitted
doc: document opening hidden files on Windows
PR-URL: #15409 Fixes: #14553 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Nikolai Vavilov <vvnicholas@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
1 parent e11c8fb commit 8b4f122

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

doc/api/fs.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,11 @@ example `fs.readdirSync('c:\\')` can potentially return a different result than
102102
`fs.readdirSync('c:')`. For more information, see
103103
[this MSDN page][MSDN-Rel-Path].
104104

105+
*Note:* On Windows, opening an existing hidden file using the `w` flag (either
106+
through `fs.open` or `fs.writeFile`) will fail with `EPERM`. Existing hidden
107+
files can be opened for writing with the `r+` flag. A call to `fs.ftruncate` can
108+
be used to reset the file contents.
109+
105110
## Threadpool Usage
106111

107112
Note that all file system APIs except `fs.FSWatcher()` and those that are

0 commit comments

Comments
 (0)