python - 哪个进程对 inotify 发出的事件负责?

标签 python inotify pyinotify

我正在使用 pyinotify 检测给定目录中文件的访问、更改等。有没有更简单的方法来找出哪个进程对此负责 - 而不必 patch inotify

最佳答案

不,你不能,该信息不在内核发送的 struct inotify_event 中。

实际上,无法保证当您收到事件时负责的进程仍在运行。

关于python - 哪个进程对 inotify 发出的事件负责?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/922200/

相关文章:

linux - 如何知道哪个进程正在更改 linux 中的文件

python - 如何仅在使用 python 更新后才从输入文件中读取文本

python - pyinotify 方法未调用

python - 满足列表列表中条件的元组中值的频率分布

python - PyGTK 2 : TreeView is extending out of my window even with scroll bar enabled

python - 将获得的结果动态分配给Python中的变量

watch - 为什么 Pyinotify 不能观看目录?

python - 访问字符串中的值

linux - inotifywait shell 脚本作为守护进程运行

python - Pyinotify——目录重命名后从原始路径引发的事件