[ Please don't post TOFU. It is considered rude an will predispose
people not to want to help you. ]
I seem to have solved my problem:
$file = "test.iso";
while (1) {
if (open(FILE, "< $file")) {
print "Transfer completed\n";
close (FILE);
}
else {
print "Not ready\n";
}
}
Is there anything undesirable about this approach?
It's a busy loop. Busy loops are undesirable on multi-taking system.
You should pause for a non-zero time between unsucessful opens.
Notes: I'm on an NT based system, and the file is being copied by a
different program. I don't want to work on the file with Perl until it's
finished being copied across.
This only works if the process writing the file is taking a manatory
exclusive lock. It also does not destinguish between a successful
transfer and an one that dies before incompletion.
If it seems to be working then it would appear that the process writing
the file is taking a manatory exclusive lock. I'm not a expert on the
intracacies of Windows' locking semantics.
As I and others have said this is not really a Perl question.