A cross-platform file change monitor with multiple backends: Apple OS X File System Events, *BSD kqueue, Solaris/Illumos File Events Notification, Linux inotify, Microsoft Windows and a stat()-based backend.
I've read the different reported issues (e.g., #144, #62) where creating a new file sometimes simultaneously reports Created and Removed events when running with -x option. I did some experimenting and have discovered that the -o option seems to consistently (correctly) report only one event.
If the issue is as described in the other issues:
OS X may return event flags of previous events for the same file if they occur sufficiently close in time.
then wouldn't -x and -o be consistent, either both reporting two events or both reporting a single event?
Steps to duplicate
Terminal session 1:
Assuming that 10 seconds is not "sufficiently close in time."
while :; do touch x; sleep 10; rm x; sleep 10; done
Terminal session 2:
Test 1 that consistently outputs a "1" for number of events.
fswatch --event Created --event Removed -o x
Test 2 that sometimes shows Created Removed and sometimes shows Removed.
fswatch v1.14.0 on macosX 10.11.6 (El Capitan)
I've read the different reported issues (e.g., #144, #62) where creating a new file sometimes simultaneously reports
Created
andRemoved
events when running with -x option. I did some experimenting and have discovered that the -o option seems to consistently (correctly) report only one event.If the issue is as described in the other issues:
then wouldn't -x and -o be consistent, either both reporting two events or both reporting a single event?
Steps to duplicate
Terminal session 1:
Assuming that 10 seconds is not "sufficiently close in time."
while :; do touch x; sleep 10; rm x; sleep 10; done
Terminal session 2:
Test 1 that consistently outputs a "1" for number of events.
fswatch --event Created --event Removed -o x
Test 2 that sometimes shows
Created Removed
and sometimes showsRemoved
.fswatch --event Created --event Removed -x -t x
Sample output
Test 1
Test 2