-
-
Notifications
You must be signed in to change notification settings - Fork 698
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
No file system events observed when not using recursive mode #918
Comments
I don't think the underlying operating system calls support watching a single file -- the watchdog code and the underlying OS API's document that it's only supported to watch a directory. While it may be possible to specify a file path without triggering an error, it's not supported. |
I totally agree with your points. However, the docs should point out that you always need to watch recursively or just default to it on some machines... |
Agreed. I got bitten by this today; a script that worked absolutely fine on my Linux box (Debian Bullseye, inotify) utterly failed to report anything on my client's Mac. Setting |
I agree that recursive could be true by default for FSEvents. Anyone willing to chime in? I will be happy to review a PR :) |
I'll have a whack at it, but I don't have a Mac to test on, so all I can say is, the tests haven't started failing on Linux. |
We tried to listen for events on a single file, without the need for watching recursively. However without specifying
recursive=True
, no events were observed.Platform: macOS 12.6 & Ubuntu 18.04
Python: 3.9.14
Code to reproduce:
and launching with:
python file.py <path to single file>
.Also using the
FSEventsObserver
on macOS didn't change the outcome. Only specifyingrecursive=True
did.The text was updated successfully, but these errors were encountered: