in reply to Linux::Inotify2 - unable to receive events

I'm facing some problems installing Linux::Inotify2 so I can't test it myself at the moment but this is what I noticed:

The SYNOPSIS of Linux::Inotify2 contains Event->... your code does not.

Did you try the examples in the Linux::Inotify2 package? eg/simple and eg/event? Did these work?

  • Comment on Re: Linux::Inotify2 - unable to receive events

Replies are listed 'Best First'.
Re^2: Linux::Inotify2 - unable to receive events
by jfroebe (Parson) on Oct 04, 2008 at 01:46 UTC

    Did more testing. Looks like the perldoc is wrong. The $inotify->poll needs to be called AFTER the $inotify->watch routines are set!</p.

    Thanks Animator for making me rethink how I was calling it.

    Jason L. Froebe

    Blog, Tech Blog

Re^2: Linux::Inotify2 - unable to receive events
by jfroebe (Parson) on Oct 04, 2008 at 01:18 UTC

    I think you're referring to the following snippet:

    # for Event: Event->io (fd =>$inotify->fileno, poll => 'r', cb => sub { $inotify-> +poll }); # for Glib: add_watch Glib::IO $inotify->fileno, in => sub { $inotify->poll }; # manually: 1 while $inotify->poll;

    These are three separate ways of creating a loop for $inotify->poll. Yup, I tried all three ways. I'm using the third method to isolate the issue.

    Thanks though

    Jason L. Froebe

    Blog, Tech Blog