-
Notifications
You must be signed in to change notification settings - Fork 27
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
Does not appear to work on Macbook Pro with M2 (ARM) silicon? #47
Comments
Running on my M1, I'm seeing a number of test failures in |
That would be great. As a workaround, I've used a shell script with tail to observe changes to the file in question. |
Looking through this again, first an observation that I don't think this library is particularly well put together (sadly). That said, the problem you're experiencing is that you can't watch a file using I don't really understand why the The documentation says:
But that is what you'd expect from Finally, I don't think this is a problem with ARM vs Intel. |
Great detective work. I guess the changes to a file could be simulated by
listening to the directory and filtering by file?
Happy to test any code.
…On Sat, 20 Apr 2024, 11:26 Malthe Borch, ***@***.***> wrote:
Looking through this again, first an observation that I don't think this
library is particularly well put together (sadly).
That said, the problem you're experiencing is that you can't watch a file
using file_events=True. It has to be a directory. If you wanted to watch
a particular file, you can do so using flags=FS_CFLAGFILEEVENTS (which is
then incompatible with the file_events option).
I don't really understand why the file_events option exists, but perhaps
FS_CFLAGFILEEVENTS – which maps to the kFSEventStreamCreateFlagFileEvents
<https://developer.apple.com/documentation/coreservices/1455376-fseventstreamcreateflags/kfseventstreamcreateflagfileevents>
flag – didn't work well at the time?
The documentation says:
Request file-level notifications. Your stream will receive events about
individual files in the hierarchy you're watching instead of only receiving
directory level notifications. Use this flag with care as it will generate
significantly more events than without it.
But that is what you'd expect from file_events, too, so why does it
exists? Not sure :-)
—
Reply to this email directly, view it on GitHub
<#47 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAJ3FJF24K2AIUINHELO5ITY6I7DNAVCNFSM6AAAAABGM5DMUKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANRXGYZTAOJXGQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Now, reading the documentation I realize that # inotify event flags
IN_MODIFY = 0x00000002
IN_ATTRIB = 0x00000004
IN_CREATE = 0x00000100
IN_DELETE = 0x00000200
IN_MOVED_FROM = 0x00000040
IN_MOVED_TO = 0x00000080 That said, yes as you suggest, using either |
Nice work! I'm working in this area for the next week so I can test any beta versions. |
I ran watchdog on my Macbook Pro (2023) and it was not generating file change events. Same code worked perfectly on Debian. This library uses macfsevents behind the scenes.
Here is a script that runs macfsevents to reproduce the issue on my Macbook Pro:
To test, edit the file
test.txt
and look for the file changed event.The text was updated successfully, but these errors were encountered: