Думаю, нужно смотреть в сторону kqueue/kevent.
Посмотри следующие модули (не проверял):
Filesys::Notify::KQueue - https://metacpan.org/pod/Filesys::Notify::KQueue
File::ChangeNotify::Watcher::KQueue - https://metacpan.org/pod/File::ChangeNotify::Watcher::KQueue AnyEvent::Filesys::Notify::Role::KQueue - https://metacpan.org/pod/AnyEvent::Filesys::Notify::Role::KQueue

Единственная проблема - с помощью kqueue/kevent невозможно смотреть большие каталоги, т.к. для каждого каталога и файла, который проверяется, открывается filehandle

Например, вот, что пишется в википедии про Gamin:

Under FreeBSD, Gamin uses kqueue/kevent as the native FreeBSD kernel event notification mechanism, but in this case kqueue has one major drawback as compared to inotify: inotify is the filename-based monitoring facility and kqueue uses file descriptors for identification of monitored files, so, under FreeBSD, gam_server has to open each file in the monitored directory. This can be an issue when monitoring directories with many files stored, because the system could easily reach its kernel limits on maximum file descriptor count (kern.maxfiles and kern.maxfilesperproc).
--
Moscow.pm mailing list
[email protected] | http://moscow.pm.org

Ответить