Closed thoni56 closed 3 years ago
On my MacOS 10.15.4, touch foo.txt
returns kFSEventStreamEventFlagItemIsFile | kFSEventStreamEventFlagItemInodeMetaMod
.
kFSEventStreamEventFlagItemInodeMetaMod
is mapped to PlatformSpecific
.
I would it make sense to map it to AttributeModified
instead?
From issue #62 :
I have observed this behaviour and I think it's due to the FSEvents API buffering and bubbling events by path I'm closing this issue because it is an effect or the FSEvents behaviour.
That buffering/bubbling explanation doesn't make sense based on behavior I see. See below. I created a file using 'touch testfswatch6.txt'. I then simply repeated this 'touch testfswatch6.txt' command multiple times.
The output from fswatch for the sequence of touches proceeds through this sequence of event flags, while issuing the same command repeatedly (with a few seconds between repeats):
Created
PlatformSpecific
Created PlatformSpecific
PlatformSpecific
PlatformSpecific
PlatformSpecific
PlatformSpecific
It doesn't make sense for it to report Created twice, does it?
Here is what I issued for commands, and their timestamps, to interact with a specific file.
13:17:26 $ touch testfswatch6.txt
13:17:36 $ touch testfswatch6.txt
13:17:49 $ touch testfswatch6.txt
13:18:39 $ touch testfswatch6.txt
13:18:56 $ touch testfswatch6.txt
13:18:58 $ touch testfswatch6.txt
13:19:02 $ rm testfswatch6.txt
Here are the results of fswatch, with timestamps:
$ fswatch . --event-flags --timestamp
Mon Jul 6 13:17:36 2020 /testfswatch6.txt Created IsFile
Mon Jul 6 13:17:36 2020 /testfswatch6.txt PlatformSpecific IsFile
Mon Jul 6 13:17:43 2020 PlatformSpecific OwnerModified AttributeModified IsDir
Mon Jul 6 13:17:49 2020 /testfswatch6.txt Created PlatformSpecific IsFile
Mon Jul 6 13:18:40 2020 /testfswatch6.txt PlatformSpecific IsFile
Mon Jul 6 13:18:57 2020 /testfswatch6.txt PlatformSpecific IsFile
Mon Jul 6 13:18:58 2020 /testfswatch6.txt PlatformSpecific IsFile
Mon Jul 6 13:19:02 2020 /testfswatch6.txt PlatformSpecific IsFile
Mon Jul 6 13:19:07 2020 /testfswatch6.txt Removed PlatformSpecific IsFile
Mon Jul 6 13:19:13 2020 PlatformSpecific OwnerModified AttributeModified IsDir
On OSX 10.13.6, fswatch 1.14.0
Fixed in master
, I'll roll out a release soon
I suddenly felt I didn't get the behaviour from some scripts I had when running on Darwin/MacOS. Investigation showed that
and then touching an existing file ´x´ gave the following output
I was expecting
... Updated isFile
or something.However touching a non-existing file gave the expected output
I suppose the underlying
fsevents
or Darwin has changed somehow.This happend (I think) after upgrading MacOS/Darwing to 10.15.4 (19E287).