I'm writing a daemon, monitoring user activity on Linux. Is there any way to detect opening arbitrary file by arbitrary process? Preferred language is Python/C/C++
Asked
Active
Viewed 89 times
3
-
You could use [`inotify(7)`](http://linux.die.net/man/7/inotify). – Lee Duhem Feb 26 '14 at 12:58
-
Related http://stackoverflow.com/questions/2023608/check-what-files-are-open-in-python – GabiMe Feb 26 '14 at 13:01
-
1possible duplicate of [How to check in python that a file in a folder has changed?](http://stackoverflow.com/questions/12582720/how-to-check-in-python-that-a-file-in-a-folder-has-changed) – Lee Duhem Feb 26 '14 at 13:01
1 Answers
1
Linux has group of inotify
system calls.
There is a Python wrapper for these called pyinotify.

vartec
- 131,205
- 36
- 218
- 244