On Sun, Apr 09, 2006 at 11:56:45PM -0700, Group wrote:
> Hi All,
> 
>  I try to use module POE::Component::Win32::ChangeNotify,
>   I would like to monitor directory with a loop (the code at
> http://search.cpan.org/~bingos/POE-Component-Win32-ChangeNotify-0.01/lib/poe/Component/Win32/ChangeNotify.pm),
> 
> so I ignore shutdown -->
>   "   $kernel->post( 'blah' => 'shutdown' );   "
>   However, it prints out twice in console .
>    
>   How can i fix it?

Hi,

It probably prints out twice because it is seeing more than one change.

I tested this by removing the 'shutdown' line and running the script.

Then i ran 'touch one two three four five' to create five new files in the 
current
directory. I then observed:

c:\D-Drive\projects\changenotify>perl test.pl
Something changed in .
Something changed in .
Something changed in .
Something changed in .
Something changed in .

You can change the filter to be more restrictive in what changes it monitors:

   ATTRIBUTES   Any attribute change
   DIR_NAME     Any directory name change
   FILE_NAME    Any file name change (creating/deleting/renaming)
   LAST_WRITE   Any change to a file's last write time
   SECURITY     Any security descriptor change
   SIZE         Any change in a file's size

Apart from that, as it is a wrapper around Win32::ChangeNotify it has the same 
limitations
of that module, ie. it'll only monitor directories and it doesn't return what 
has changed,
just that a change has occured.

I hope that clears up things.

Cheers,

-- 
Chris Williams
aka BinGOs
PGP ID 0x4658671F
http://www.gumbynet.org.uk
==========================

Attachment: pgpRJ21JkkPdZ.pgp
Description: PGP signature

Reply via email to