Impove fs.WatchFile doc
This commit is contained in:
parent
e6ede31554
commit
bf8f4aa966
@ -306,7 +306,7 @@ The synchronous version of `fs.writeFile`.
|
|||||||
### fs.watchFile(filename, [options], listener)
|
### fs.watchFile(filename, [options], listener)
|
||||||
|
|
||||||
Watch for changes on `filename`. The callback `listener` will be called each
|
Watch for changes on `filename`. The callback `listener` will be called each
|
||||||
time the file changes.
|
time the file is accessed.
|
||||||
|
|
||||||
The second argument is optional. The `options` if provided should be an object
|
The second argument is optional. The `options` if provided should be an object
|
||||||
containing two members a boolean, `persistent`, and `interval`, a polling
|
containing two members a boolean, `persistent`, and `interval`, a polling
|
||||||
@ -322,6 +322,10 @@ stat object:
|
|||||||
|
|
||||||
These stat objects are instances of `fs.Stat`.
|
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.
|
||||||
|
|
||||||
|
|
||||||
### fs.unwatchFile(filename)
|
### fs.unwatchFile(filename)
|
||||||
|
|
||||||
Stop watching for changes on `filename`.
|
Stop watching for changes on `filename`.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user