diff options
author | Brendan Ashworth <brendan.ashworth@me.com> | 2015-07-01 08:13:54 -0700 |
---|---|---|
committer | Brendan Ashworth <brendan.ashworth@me.com> | 2015-07-10 14:24:50 -0700 |
commit | 23efb05cc3e319962154f2dc0fffcd2d6749405d (patch) | |
tree | e9e26ef977d2544096afc64dc42358ca68740dd0 /doc | |
parent | 1afc0c9e86025693a157df935edbe72d7296055d (diff) | |
download | android-node-v8-23efb05cc3e319962154f2dc0fffcd2d6749405d.tar.gz android-node-v8-23efb05cc3e319962154f2dc0fffcd2d6749405d.tar.bz2 android-node-v8-23efb05cc3e319962154f2dc0fffcd2d6749405d.zip |
doc: document fs.watchFile behaviour on ENOENT
When fs.watchFile encounters an ENOENT error, it invokes the given
callback with some error data. This caused an issue as it was different
behaviour than Node v0.10. Instead of changing this behaviour, document
it and add a test.
Ref: https://github.com/nodejs/io.js/issues/1745
Ref: https://github.com/nodejs/io.js/pull/2028
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
PR-URL: https://github.com/nodejs/io.js/pull/2093
Diffstat (limited to 'doc')
-rw-r--r-- | doc/api/fs.markdown | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/doc/api/fs.markdown b/doc/api/fs.markdown index bb90cc8d2e..985a4e4c96 100644 --- a/doc/api/fs.markdown +++ b/doc/api/fs.markdown @@ -576,6 +576,9 @@ These stat objects are instances of `fs.Stat`. If you want to be notified when the file was modified, not just accessed you need to compare `curr.mtime` and `prev.mtime`. +_Note: when an `fs.watchFile` operation results in an `ENOENT` error, it will +invoke the callback once. This is a change in functionality since v0.10._ + _Note: `fs.watch` is more efficient than `fs.watchFile` and `fs.unwatchFile`. `fs.watch` should be used instead of `fs.watchFile` and `fs.unwatchFile` when possible._ |