问题
I've written a few lines of C code using the inotify API. When I monitor for IN_CREATE and IN_DELETE for /tmp it works no problem. I can detect when I add or delete folders in /tmp.
When I change the monitored folder to /proc, I do not get notified when a new directory is created in /proc due to a process launch.
I assume this is because /proc is special in some way. Can anyone explain why this is the case or what I might do to allow inotify to watch that folder?
Thanks.
回答1:
The stuff in /proc
is a pseudo-filesystem, they aren't actually files. The purpose of the interface is to allow userland processes to read or set kernel parameters with a familiar interface.
来源:https://stackoverflow.com/questions/24897799/why-cant-i-monitor-proc-using-the-inotify-c-api-is-it-special