http://www.perlmonks.org?node_id=536407


in reply to Re^2: Problem with POE-Component-DirWatch
in thread Problem with POE-Component-DirWatch

Thanks for all monks! I try to modify the filter to
Filter => sub { $_[0] =~ /.txt$/ && -f $_[1] },
then I re-run, it print the following message repeatly until i del file test.txt manually
Tue Mar 14 06:41:06 2006 test.txt (C:\temp\test.txt) Tue Mar 14 06:41:06 2006 test.txt (C:\temp\test.txt)
however I try paste new_test.txt to c:\temp\, it seems no response (May be the same with runrig) my perl version is "v5.8.4 built for MSWin32-x86-multi-thread"

Replies are listed 'Best First'.
Re^4: Problem with POE-Component-DirWatch
by runrig (Abbot) on Mar 13, 2006 at 23:08 UTC
    Find the rewind line in the poll subroutine in the module and replace it with:
    # rewind to directory start # $heap->{DirHandle}->rewind; $heap->{DirHandle}->close; $heap->{DirHandle}->open($heap->{Directory}) or croak "Can't open $heap->{Directory}: $!\n";
    The module and your code seem to work with the above changes. (I've emailed the module author with a link to this thread).