Hi all:

I'm struggling to implement the win32::Changenotify method in a script.

I'm watching a directory tree into which TIF files are scanned.  I'm using
the ChangeNotify method to kick the script into action when a new TIF file
is saved to the directory tree.

The relevent code snippet :

...............  

$NewTIFF = Win32::ChangeNotify->new("i:\\",True,"FILE_NAME");
while(True)
{

        $NewTIFF->wait or warn "Somethings wrong:  $!\n";

        foreach(@TIFFDirs)
        {
        ###  processing each directory  #####
        }

        $NewTIFF->reset;
}

......................


I expected the $NewTIFF->wait line to wait indefinitely until a new TIF file
was saved, then to continue the script.
When I'm debugging the script, I'm finding that it waits on that line, but
doesn't move when new files are saved.  It just seems to freeze on that
line!

Am I using the ChangeNotify method in the right way??

When reading the docs on ChangeNotify & win32::IPC, I see that $Obj->wait
returns 1 if a change has been detected.   Do I assume correctly that once
the "1" has been returned, that the script will continue from that line?

Regs
Rupert Heesom
Asst Distribution Engineer
Adventist World Radio


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to