AnyEvent-Inotify-Simple
view release on metacpan or search on metacpan
lib/AnyEvent/Inotify/Simple.pm view on Meta::CPAN
use AnyEvent::Inotify::Simple;
use EV; # or POE, or Event, or ...
my $inotify = AnyEvent::Inotify::Simple->new(
directory => '/tmp/uploads/',
wanted_events => [ qw(create move) ],
event_receiver => sub {
my ($event, $file, $moved_to) = @_;
given($event) {
when('create'){
say "Someone just uploaded $file!"
}
};
},
);
EV::loop;
=head1 DESCRIPTION
This module is a wrapper around L<Linux::Inotify2> that integrates it
( run in 1.549 second using v1.01-cache-2.11-cpan-9169edd2b0e )