Hi, I was just exploring File::NFSLock to lock files on the NFS server but seems like its not working. It ends up creating stale files and only option left is to abort the script. I am testing it on NFSv3
Anybody had any success in using this module? Here is my sample code. use strict; use warnings; use File::NFSLock qw(uncache); use Fcntl qw(LOCK_EX LOCK_NB); print "Please enter the file to be locked:\n"; chomp(my $file = <STDIN>); open my $fh, '>', $file or die $!; print $fh "Hello World"; print "Please try to write to the file\n"; my $wait = <STDIN>; #my $lock = File::NFSLock->new($file,LOCK_EX|LOCK_NB,10*60,30*60); my $lock = File::NFSLock->new($file,LOCK_EX,10*60,30*60); print "File is now locked. Now again try to write to the file\n"; $wait = <STDIN>; print "Lock operation over\n"; ~Parag