Hi all,
I have following code:
use 5.004'
use Fcntl ':flock';
sub check_file_stat us
{
$attempt_lock = 0;
$max_attempts = 3;
open(in_file, "$check_in_file _name");
while (!flock(in_file , LOCK_EX) && $attemp_lock < $max_attempts)
{
sleep(5);
}
close(in_file);
}
I cannot get the exlusive lock for the $check_in_file_ name variable
file name. Any idea? How should I correct my mistake?
I have following code:
use 5.004'
use Fcntl ':flock';
sub check_file_stat us
{
$attempt_lock = 0;
$max_attempts = 3;
open(in_file, "$check_in_file _name");
while (!flock(in_file , LOCK_EX) && $attemp_lock < $max_attempts)
{
sleep(5);
}
close(in_file);
}
I cannot get the exlusive lock for the $check_in_file_ name variable
file name. Any idea? How should I correct my mistake?
Comment