diff options
author | Nikolai Vavilov <vvnicholas@gmail.com> | 2016-04-02 16:44:18 +0300 |
---|---|---|
committer | James M Snell <jasnell@gmail.com> | 2016-04-18 16:03:04 -0700 |
commit | cf29b2f815967ab9e5638dd6e3138a040fa775f9 (patch) | |
tree | d5ef37933f1aff64ba1838fb4ab40ab1705f8e1d /doc | |
parent | 1d9451bb5aef0733f6fb5c5b95d33a31e04f5462 (diff) | |
download | android-node-v8-cf29b2f815967ab9e5638dd6e3138a040fa775f9.tar.gz android-node-v8-cf29b2f815967ab9e5638dd6e3138a040fa775f9.tar.bz2 android-node-v8-cf29b2f815967ab9e5638dd6e3138a040fa775f9.zip |
doc: document intention and dangers of fs module Buffer API
PR-URL: https://github.com/nodejs/node/pull/6020
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'doc')
-rw-r--r-- | doc/api/fs.markdown | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/doc/api/fs.markdown b/doc/api/fs.markdown index 8a05ffa3c2..22eb14c9da 100644 --- a/doc/api/fs.markdown +++ b/doc/api/fs.markdown @@ -94,6 +94,18 @@ Error: EISDIR, read <etc.> ``` +## Buffer API + +`fs` functions support passing and receiving paths as both strings +and Buffers. The latter is intended to make it possible to work with +filesystems that allow for non-UTF-8 filenames. For most typical +uses, working with paths as Buffers will be unnecessary, as the string +API converts to and from UTF-8 automatically. + +*Note* that on certain file systems (such as NTFS and HFS+) filenames +will always be encoded as UTF-8. On such file systems, passing +non-UTF-8 encoded Buffers to `fs` functions will not work as expected. + ## Class: fs.FSWatcher Objects returned from `fs.watch()` are of this type. |