Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

cdarke's scratchpad

by cdarke (Prior)
on Apr 27, 2006 at 00:44 UTC ( #545917=scratchpad: print w/ replies, xml ) Need Help??

use Win32::ChangeNotify; my $Path = 'C:\\QA'; my $Events = 'FILE_NAME'; my $notify = Win32::ChangeNotify->new($Path,0,$Events); my %dir; @dir{glob("$Path\\*")} = undef; while (1) { print STDERR 'Waiting...'; $notify->wait or warn "Wait failed: $!\n"; $notify->reset(); my @files = glob("$Path\\*"); my @added = grep {!exists $dir{$_}} @files; print "Filenames added: @added\n" if @added; delete @dir{@files}; my @removed = keys %dir; print "Filenames removed: @removed\n" if @removed; undef %dir; @dir{@files} = undef; } $notify->close();
Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (7)
As of 2015-07-08 00:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (93 votes), past polls