POE::Component::DirWatch::Object::Untouched
use POE::Component::DirWatch::Object::Untouched; #$watcher is a PoCo::DW:Object::Untouched my $watcher = POE::Component::DirWatch::Object::Untouched->new ( alias => 'dirwatch', directory => '/some_dir', filter => sub { $_[0] =~ /\.gz$/ && -f $_[1] }, callback => \&some_sub, interval => 5, stat_interval => 2, #pick up files if they are untouched after 2 seconds ); $poe_kernel->run;
POE::Component::DirWatch::Object::Untouched extends DirWatch::Object in order to exclude files that appear to be in use or are actively being changed.
Read-Write. An integer value that specifies how many seconds to wait in between the call to dispatch and the actual dispatch. The interval here serves as a dead period in between when the initial stat readings are made and the second reading is made (the one that determines whether there was any change or not). Note that the interval in POE::Component::DirWatch::Object will be delayed by this length. See _stat_check for details.
interval
POE::Component::DirWatch::Object
_stat_check
An Array::Compare object
after '_start' the kernel is called and a new 'stat_check' event is added.
after '_start'
override '_dispatch' to delay and delegate the dispatching to _stat_check. Filtering still happens at this stage.
override '_dispatch'
Schedule a callback event for every file whose contents have not changed since the poll event. After all callbacks are scheduled, set an alarm for the next poll.
poll
ARG0 should be the proper params for callback and ARG1 the original stat() reading we are comparing against.
callback
stat()
Keeping tests happy.
POE::Component::DirWatch::Object, Moose
Guillermo Roditi, <groditi@cpan.org>
If a file is created and deleted between polls it will never be seen. Also if a file is edited more than once in between polls it will never be picked up.
Please report any bugs or feature requests to bug-poe-component-dirwatch-object at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=POE-Component-DirWatch-Object. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-poe-component-dirwatch-object at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc POE::Component::DirWatch::Object::Untouched
You can also look for information at:
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/POE-Component-DirWatch-Object
CPAN Ratings
http://cpanratings.perl.org/d/POE-Component-DirWatch-Object
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=POE-Component-DirWatch-Object
Search CPAN
http://search.cpan.org/dist/POE-Component-DirWatch-Object
People who answered way too many questions from an inquisitive idiot:
Copyright 2006 Guillermo Roditi. All Rights Reserved. This is free software; you may redistribute it and/or modify it under the same terms as Perl itself.
To install POE::Component::DirWatch::Object, copy and paste the appropriate command in to your terminal.
cpanm
cpanm POE::Component::DirWatch::Object
CPAN shell
perl -MCPAN -e shell install POE::Component::DirWatch::Object
For more information on module installation, please visit the detailed CPAN module installation guide.