diff --git a/lib/nodefs-handler.js b/lib/nodefs-handler.js index d65060ec..bffe4233 100644 --- a/lib/nodefs-handler.js +++ b/lib/nodefs-handler.js @@ -264,12 +264,24 @@ function(file, stats, initialAdd, callback) { if (error) { this._remove(dirname, basename); } else { - this._emit('change', file, newStats); + // check that change event was not fired coz of changed accessTime + if ( + !newStats.atime.getTime() || + newStats.atime.getTime() <= newStats.mtime.getTime() + ) { + this._emit('change', file, newStats); + } } }.bind(this)); // add is about to be emitted if file not already tracked in parent } else if (parent.has(basename)) { - this._emit('change', file, newStats); + // check that change event was not fired coz of changed accessTime + if ( + !newStats.atime.getTime() || + newStats.atime.getTime() <= newStats.mtime.getTime() + ) { + this._emit('change', file, newStats); + } } }.bind(this));