You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
12 lines
314 B
Perl
12 lines
314 B
Perl
while (-e "flockTest.lck") {
|
|
print "waiting for lock\n"; sleep(1.0);
|
|
}
|
|
|
|
open (LOCK, ">flockTest.lck") || die "Lock error $!";
|
|
open (OUTFILE, ">>flockTest.txt") || warn $!;
|
|
print ("This process now owns the Exclusive lock\n");
|
|
|
|
$in = <STDIN>;
|
|
close (OUTFILE);
|
|
close (LOCK);
|
|
unlink ("flockTest.lck"); |