Thankx everybody for ur interest.... on this
I modified my code like following ...
use Win32::ChangeNotify;
print " \n Enter a file path ";
$pt = <STDIN>;
chomp $pt;
$notify = Win32::ChangeNotify->new($pt, true ,"SIZE");
$cnt = 0;
while(1)
{
$cnt++;
if ($cnt > 1) {
print " \n File copy is going on ";
$notify->reset;
}
$lmt--;
next if ($notify->wait(10000));
print " \n The counter value is $cnt \n ";
last;
}
print " \n hello world ";
$notify->Close();
after I set one file for copy if I execute the script it will only show the result as following:
"The counter value is 1"
"hello world ."
That means it is not iterating through the loop after 1 st wait call because wait call unable to get signalled within 10000 milliseonds although hfe file copy still is going on.. . I think because while copying windows allocates size priorly in the destination as same size of source thats why although its being copied and getting increased in sized.. the $notify->wait(10000) call unable to detect the changes in filesize.
|