in reply to Re: How to do a blocking readdir or similar
in thread How to do a blocking readdir or similar

POSIX doesn't provide such a hook, so most unix-like systems also don't have such a hook
Actually, Linux provides such a hook. Check out SGI::FAM for using the file alteration monitor based on dnotify or Linux::Inotify2 for newer kernels.
  • Comment on Re^2: How to do a blocking readdir or similar

Replies are listed 'Best First'.
Re^3: How to do a blocking readdir or similar
by Kanji (Parson) on Dec 19, 2005 at 06:25 UTC

    OS X (which the OP was using) shares more with FreeBSD than Linux, so IO::KQueue is probably a more appropriate choice.

    From the README...

    This module is a low level interface to the FreeBSD and Mac OS X kqueue() system call. This is basically equivalent to epoll() on Linux - a high performance poll() replacement.

        --k.


Re^3: How to do a blocking readdir or similar
by james2vegas (Chaplain) on Aug 24, 2009 at 07:38 UTC
    SGI::FAM seems like a more compatible and less linux-only solution, and fam should run on Mac Os X (and BSDs of all stripes really, as it can be compiled to run with kqueue

    Update: Maybe that is not such a good recommendation, SGI::FAM depends on deprecated File::PathConvert, has an unregistered dependency on Test::Helper and doesn't find my libfam without help.
    After that, it does seem to work, though, quite well, though only on famd started as a daemon, not running through inetd.