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

watchdog on MacOS not generating event for file metadata modification (e.g. tags, Finder Comment) #694

Closed
tom-n-pdx opened this issue Oct 20, 2020 · 3 comments

Comments

@tom-n-pdx
Copy link

Problem: Using watchdog on MacOS changes to an existing file's metadata are not being reported via an event.

I'm using a FileSystemEventHandler handler that reports all events and monitoring a file tree on my MacBook APFS hard drive.

How to reproduce: Add a user tag via Finder. No event is generated.

File creations, renames and deletions are reported ok. A Finder comment change generates a modification event for the .DS_Store file in the directory. This is a limitation of where Finder comments are stored by MacOS and I can work around it.

Why: I'm monitoring a filesystem to sync data between the hard drive and cloud and want to sync modifications to user tags and com.apple.metadata:KMDItem spotlight metadata.

Workaround: I'm open to suggestions- right now my plan is to do a full file tree walk every hour and look for changes in metadata.

Versions: watchdog 0.10.3 on MacOS 10.15.7 with Python 3.8.6 (homebrew install).

@BoboTiG
Copy link
Collaborator

BoboTiG commented Oct 21, 2020

Hello,

It should work but I just saw that we have no tests (https://github.com/gorakhargosh/watchdog/search?q=xattr). So maybe is there a bug there. We should start by adding a test and see if the CI fails.

@CCP-Aporia
Copy link
Contributor

Thanks for the detailed report!

The changes in #716 are going to resolve this problem - the given reproduction is going to result in a FileModifiedEvent there. It's just a matter of re-creating them for mainline, which I hope to get done this week.

@BoboTiG
Copy link
Collaborator

BoboTiG commented Dec 10, 2020

Done with 614ccfc.

@BoboTiG BoboTiG closed this as completed Dec 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants