I am working with python watchdog for a side project and I was running into an issue where sometimes when a file was created/modified watchdog only says
INFO:root:Modified directory: /home/foo/bar
instead of what I expected which would be something like
INFO:root:Modified file: /home/foo/bar/.config
or (emacs temp file)
INFO:root:Modified file: /home/foo/bar/.#config
I am currently messing with the LoggingEventHandler as well as trying to subclass it to see if I can work around the issue. Why is it that when certain files (seems to be hidden files) cause watchdog to say only the directory was modified and not also spit out file modified event?
Text editors commonly creates a backup file and saves a new copy and not actually edit the file. The events you will get instead are move
and create
. Plus: delete
for the old swap file if it existed, and modify
for the directory since a new file was created in it. The behavior is noted in the README. I assume this is what you're seeing since you mentioned emacs temp file.