According to the API docs for Node 0.4.3, the fs.watchFile(filename, [options], listener)
function starts a routine that will
Watch for changes on
filename
. Thecallback
listener will be called each time the file is accessed.
It also says
The
options
if provided should be an object containing two members a boolean,persistent
, andinterval
, a polling value in milliseconds
Which indicates that it will check every so often based on what is in interval. But it also says
The default is
{ persistent: true, interval: 0 }
.
So does that mean it will check every millisecond to see if the file time changed? Does it listen for OS level events? How does that work?