Is there a way to tell if a directory is in use by another program?
I have a (non-perl) program running on win2k which does this..
It creates a folder and starts filling it with data until it reaches a size anywhere from 500MB to 550MB.
When it's done with the first folder it creates another one and so on...
I want to be able to check each folder periodically to see if it's complete but I'm not sure what the best way to do this is. Currently the perl script trys to rename the folder until it's successful:
$rtn = 0;
while ($rtn == 0){
$rtn = rename($oldName, $newName) or warn "still processing...\n\n";
sleep(10);
}
print qq($oldName has been renamed\n\n);
This works, but doesn't seem very reliable to me.. is there a way to check if another program has a handle on a directory?
I have a (non-perl) program running on win2k which does this..
It creates a folder and starts filling it with data until it reaches a size anywhere from 500MB to 550MB.
When it's done with the first folder it creates another one and so on...
I want to be able to check each folder periodically to see if it's complete but I'm not sure what the best way to do this is. Currently the perl script trys to rename the folder until it's successful:
$rtn = 0;
while ($rtn == 0){
$rtn = rename($oldName, $newName) or warn "still processing...\n\n";
sleep(10);
}
print qq($oldName has been renamed\n\n);
This works, but doesn't seem very reliable to me.. is there a way to check if another program has a handle on a directory?