Skip to content

Commit

Permalink
doc: document fs.write limitation with TTY
Browse files Browse the repository at this point in the history
Fixes: #24550
  • Loading branch information
mcollina committed Nov 22, 2018
1 parent 69cc58d commit 3db07ff
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions doc/api/fs.md
Original file line number Diff line number Diff line change
Expand Up @@ -3528,6 +3528,13 @@ On Linux, positional writes don't work when the file is opened in append mode.
The kernel ignores the position argument and always appends the data to
the end of the file.

On Windows, if the file descriptor is connected to the console (e.g. `fd == 1`
or `stdout`) a string encoded as UTF-8 or Unicode (`ucs2`) will not be rendered
properly by default.
It is possible to configure the console to render UTF-8 properly by changing the
active codepage with the `chcp 65001` command. See the [chcp][] docs for more
details.

## fs.writeFile(file, data[, options], callback)
<!-- YAML
added: v0.1.29
Expand Down Expand Up @@ -4926,3 +4933,4 @@ the file contents.
[MSDN-Using-Streams]: https://docs.microsoft.com/en-us/windows/desktop/FileIO/using-streams
[support of file system `flags`]: #fs_file_system_flags
[File Access Constants]: #fs_file_access_constants
[chcp]: https://ss64.com/nt/chcp.html

0 comments on commit 3db07ff

Please sign in to comment.