Greetings,
This is on XP Pro and Win Server 2003
Script is monitoring a shared directory for incoming files. File arrives, is
seen and is processed.
Files are placed in this share by users across a global WAN so it can be some
time before the
copy is complete and the file is truly available for processing - maybe 30
minutes from the
time the file is first seen, so I need to test for this.
BTW the monitor is based on Roth's dirmon.pl
Looking at file size doesn't help since windoze reports finished size as soon
as the first byte arrives.
Here's how I thought I could do it...
until(-W $File->{fullPath} . "/" . $File->{name} )
{
print LOG "Waiting for copy completion
$File->{fullPath}" . "/" . $File->{name} . "\n";
sleep(15);
}
print LOG "Starting process....\n";
Unfortunately -W (or -w -r or any others that look interesting) don't seem to
do what I want so
when the file first appears, script goes straight to processing.
The one thing that works is to try to move the file to another location and
loop like above until the
move is successful. Then I have to move it back to get on with processing. This
seems to
be unnecessarily clunky. Anybody got a better method please?
TIA - Lynn.
_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs