diff options
author | NiveditN <niveditn@gmail.com> | 2017-10-09 10:19:07 +0300 |
---|---|---|
committer | Michaƫl Zasso <targos@protonmail.com> | 2017-10-18 09:33:17 +0300 |
commit | 57b7f401ee245407f78c5d134bdada75851149c0 (patch) | |
tree | be7188d37c3202cb3b02ecc246a7aa4583597cab /doc | |
parent | 6ebdd989f80b2f3556b7488351dc507181343ed5 (diff) |
doc: added note to fs.watchFile on previousStat
Explains the expected behavior of previousStat in fs.watchFile() when
a watched file disappears and reappears.
PR-URL: https://github.com/nodejs/node/pull/16099
Fixes: https://github.com/nodejs/node/issues/15364
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Claudio Rodriguez <cjrodr@yahoo.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Diffstat (limited to 'doc')
-rw-r--r-- | doc/api/fs.md | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/doc/api/fs.md b/doc/api/fs.md index 67200b6c38d..f694223ace3 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -2560,6 +2560,15 @@ v0.10. `fs.unwatchFile`. `fs.watch` should be used instead of `fs.watchFile` and `fs.unwatchFile` when possible. +*Note:* When a file being watched by `fs.watchFile()` disappears and reappears, +then the `previousStat` reported in the second callback event (the file's +reappearance) will be the same as the `previousStat` of the first callback +event (its disappearance). + +This happens when: +- the file is deleted, followed by a restore +- the file is renamed twice - the second time back to its original name + ## fs.write(fd, buffer[, offset[, length[, position]]], callback) <!-- YAML added: v0.0.2 |