Reputation: 51393
fs.watch(*file*, function(event, filename){
console.log('event ' + event);
console.log('filename ' + filename);
});
when the file changes this is outputting:
event: change
filename: null
Any ideas what could cause this? I'm on OSX.
Thanks!
Upvotes: 3
Views: 723
Reputation: 37081
From the documentation:
When watching a directory, providing filename argument in the callback is not supported on every platform (currently it's only supported on Linux and Windows). Even on supported platforms filename is not always guaranteed to be provided. Therefore, don't assume that filename argument is always provided in the callback, and have some fallback logic if it is null.
Upvotes: 5