Win32::FileSystem::Watcher - Watch a Win32 file system for changes (asynchronously).
use Win32::FileSystem::Watcher; my $watcher = Win32::FileSystem::Watcher->new( "c:\\" ); # or my $watcher = Win32::FileSystem::Watcher->new( "c:\\", notify_filter => FILE_NOTIFY_ALL, watch_sub_tree => 1, ); $watcher->start(); print "Monitoring started."; sleep(5); # Get a list of changes since start(). my @entries = $watcher->get_results(); # Get a list of changes since the last get_results() @entries = $watcher->get_results(); # ... repeat as needed ... $watcher->stop(); # or undef $watcher foreach my $entry (@entries) { print $entry->action_name . " " . $entry->file_name . "\n"; } # Restart monitoring # $watcher->start(); # ... # $watcher->stop();
TODO
Win32::API Win32::MMF
There are no known bugs in this module. Please report problems to Andres N. Kievsky (ank@ank.com.ar) Patches are welcome.
Andres N. Kievsky (ank@ank.com.ar)
Copyright (c) 2008 Andres N. Kievsky (ank@ank.com.ar). All rights reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
To install Win32::FileSystem::Watcher, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Win32::FileSystem::Watcher
CPAN shell
perl -MCPAN -e shell install Win32::FileSystem::Watcher
For more information on module installation, please visit the detailed CPAN module installation guide.