document updated 14 years ago, on Sep 17, 2010
Linux's inotify feature is neato keen.
Perl can use inotifywait -m without too much trouble. However, it's also possible to do this natively.
- Linux::Inotify2 — suggests it's a lot better than Linux::Inotify, and its reviews seem to agree (however, note it requires compilation of a .xs)
- Linux::Inotify — pure Perl, doesn't need to compile a .xs, since it uses syscall
updating our watchlist
Something that inotifywait does, that I haven't seen others do, is keep its watch-list auto-updated, when doing recursive-watches:
- IN_CREATE — if the new thing is a directory, then start watching
- IN_MOVED_TO — if the "to" location is still within our watch area, then update our internal list of what the original filename was
- IN_MOVED_FROM without IN_MOVED_TO — it got moved outside our watch area, so unwatch it