seb-m / pyinotify

Monitoring filesystems events with inotify on Linux.
http://github.com/seb-m/pyinotify/wiki
MIT License
2.29k stars 377 forks source link

How do I know which program has moved the file? #145

Open kubeoperater opened 7 years ago

kubeoperater commented 7 years ago

How do I know which program has moved the file?

itdaniher commented 7 years ago

You can't, essentially. See these threads. It's by design.

itdaniher commented 7 years ago

I added another example to the fork I'm maintaining (for now) which monitors the linker file to trigger rescanning the running processes with psutil. You can see the code here: async_process_notifier.py

I also have a project which uses fanotify (similar to inotify) to great effect - https://github.com/itdaniher/nixmon - downside is it requires redis running for sharing state, but python-fanotify might be what you need.