in reply to Problem with POE-Component-DirWatch

I get the same behavior. I suspect that it's due to POE::Component::DirWatch's poll routine not opening the directory on every poll, but opening it once and then rewinding it after that. New files never get processed, just the first list of files that were returned on the first poll. I don't know whether to consider this a bug in the POE::Component::DirWatch or Win32's implementation of rewinddir. You could patch the poll routine to open the directory on every poll.

Update: Better yet, it would probably be best to modify the module to use Win32::ChangeNotify on Windows.

Update: Win32::ChangeNotify followup here

  • Comment on Re: Problem with POE-Component-DirWatch

Replies are listed 'Best First'.
Re^2: Problem with POE-Component-DirWatch
by sgt (Deacon) on Mar 13, 2006 at 23:36 UTC
    Actually talking un*x, if you open a file, do stuff and at some point rewind it, i would not like the system to close and reopen the descriptor for me; they are many reasons: many passes onthe same file, descriptor sharing with children...etc I would expect the same behaviour for dir handles; this means rewinding makes you look at the same structure again... % perldoc -f rewinddir rewinddir DIRHANDLE Sets the current position to the beginning of the directory for the "readdir" routine on DIRHANDLE. it does not say the handle is closed and then reopened... actually a poor man's rewinddir will do just that... from what you say it seems this time that it is perl on unix that does it wrong (poorly)...this should be filed as a bug
Re^2: Problem with POE-Component-DirWatch
by benlaw (Scribe) on Mar 14, 2006 at 00:45 UTC