Cannot lock a file.
From: Hon Seng Phuah (hsphuah_at_usa.com)
Date: 03/24/04
- Next message: Laszlo: "copying *.txt files recursively"
- Previous message: Reynold DeMarco Jr: "study_hall"
- Next in thread: Alex939393929: "Re: Cannot lock a file."
- Reply: Alex939393929: "Re: Cannot lock a file."
- Reply: Hon Seng Phuah: "Re: Cannot lock a file."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 24 Mar 2004 00:14:01 -0800
Hi all,
I have following code:
use 5.004'
use Fcntl ':flock';
sub check_file_status
{
$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?
- Next message: Laszlo: "copying *.txt files recursively"
- Previous message: Reynold DeMarco Jr: "study_hall"
- Next in thread: Alex939393929: "Re: Cannot lock a file."
- Reply: Alex939393929: "Re: Cannot lock a file."
- Reply: Hon Seng Phuah: "Re: Cannot lock a file."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|