Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PlatformSpecific instead of Updated on Darwin 19.4 #243

Closed
thoni56 opened this issue May 8, 2020 · 3 comments
Closed

PlatformSpecific instead of Updated on Darwin 19.4 #243

thoni56 opened this issue May 8, 2020 · 3 comments

Comments

@thoni56
Copy link

thoni56 commented May 8, 2020

I suddenly felt I didn't get the behaviour from some scripts I had when running on Darwin/MacOS. Investigation showed that

$ fswatch . --event-flags

and then touching an existing file ´x´ gave the following output

/private/tmp/utman-test/x PlatformSpecific IsFile

I was expecting ... Updated isFile or something.

However touching a non-existing file gave the expected output

/private/tmp/utman-test/zz Created IsFile

I suppose the underlying fsevents or Darwin has changed somehow.

This happend (I think) after upgrading MacOS/Darwing to 10.15.4 (19E287).

@c960657
Copy link
Contributor

c960657 commented Jun 11, 2020

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?

@steamfire
Copy link
Contributor

steamfire commented Jul 6, 2020

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

@emcrisostomo
Copy link
Owner

Fixed in master, I'll roll out a release soon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants