Hello Oliver,

If you are running under WinNT or Win2k,  you can use my
AdvNotify() it will easily and efficiently do what you want..

http://www.generation.net/~aminer/Perl/AdvNotify.html

Here is what will look like your script:
=============================================

 #!perl -w

use Win32::AdvNotify qw(INFINITE Yes No All %ActionName %ActionColor);

my $obj = new Win32::AdvNotify() || die "Can't create object\n";


$path="r:";
$Sig_Path = $path . "\\sig";

# Start you threads

my $Thr1 = $obj->StartThread(Directory      => $Sig_Path ,
                                                 Filter             =>  All ,
                                                WatchSubtree =>  Yes )
                                                 || die "Can't start thread\n";

$Thr1->EnableWatch() || die "Problem starting EnableWatch()\n";

  print "\n";

 while($Thr1->Wait(INFINITE))# you can manualy exit from the loop
                                                    #  with [Ctrl-C] signal  or use 
[Crtl-Break]
                                                    # to exit completely ..
    {
    while($Thr1->Read(\@data))# exit when the list is empty
    {for($i=0;$i<=$#data;$i++)
    {$obj->TextColor($ActionColor{$data[$i]->{Action}});
    print $data[$i]->{Directory}.$data[$i]->{FileName}." ".
    $ActionName{$data[$i]->{Action}}." on ".$data[$i]->{DateTime}."\n";

#  transfer your data here with the tcp socket...

 }}}

    # never forget to terminate your threads.

    $Thr1->Terminate();  # terminate your thread

    # never forget to call the destructor

    undef $obj;

 =============================================


Regards,
Amine








---
You are currently subscribed to perl-win32-users as: [archive@jab.org]
To unsubscribe, forward this message to
         [EMAIL PROTECTED]
For non-automated Mailing List support, send email to  
         [EMAIL PROTECTED]

Reply via email to