-
Notifications
You must be signed in to change notification settings - Fork 74
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
Add support for watching a single file #80
Comments
Hi @chrisinmtown When the old file is deleted, the watch created on that file becomes invalid and it is deleted automatically. You can see the old file being replaced by the new file if you monitor the parent directory. Hopes you get some insight from it. |
I understand that the prereq for monitoring a file with inotify is that it must exist first. I also understand that user-facing editors may do all kinds of strange things. Anyhow I solved my problem by switching to package notify_simple which supports watching a single file just fine. |
Thanks chrisinmtown. That's what I was looking for and was kind of confused by this package. |
Extend PyInotify to allow python code to watch just a file.
If I'm reading the Linux system call doc correctly, inotify() supports watching a directory or a file:
https://man7.org/linux/man-pages/man7/inotify.7.html
But adding a watch on a file causes PyInotify to throw an exception:
[Errno 20] Not a directory: '/tmp/file.json/'
Please tell me if I'm missing something obvious? Thanks for considering it.
The text was updated successfully, but these errors were encountered: