解决方法
如果你很幸运能够使用基于debian的发行版,那么apt-get install会进行dnotify.其他发行版可能有类似的东西 – 寻找dnotify名称.
dnotify is a simple program based on Linux kernel 2.4.19+’s dnotify API.
dnotify can execute a specified command each time the content of a specific
directory changes. It is run from the command line and takes two arguments:
one or more directories to monitor and a command to execute whenever a
directory has changed. Options control what events to trigger on: when a file
was read in the directory,when one was created,deleted and so on.
如果您想在自己的程序中处理此问题,则dnotify也是您要使用的API.