Intrepid has asked for the wisdom of the Perl Monks concerning the following question:
Hello good monks and nuns. I'm in the build directory for the distribution File::NFSLock working on installing it as I'm doing with hundreds of modules I've made a bundle of on one machine, getting them put in place on a new machine (finally figured out how that works). The tests in File-NFSLock stagger to a halt, freezing up in the code shown below, which is in t/120_single.t
Is it possible that the lock operations are breaking because I have the build directories for these modules on a FAT32 filesystem, rather than NTFS? Wild guess.
# Blocking Exclusive test within a single process (no fork) use Test::More tests => 2; use File::NFSLock; use Fcntl qw(O_CREAT O_RDWR O_RDONLY O_TRUNC LOCK_EX); use File::Temp qw(tempfile); my $datafile = (tempfile 'XXXXXXXXXX')[1]; # Create a blank file sysopen ( my $fh, $datafile, O_CREAT | O_RDWR | O_TRUNC ); close ($fh); ok (-e $datafile && !-s _); # Wipe any old stale locks unlink "$datafile$File::NFSLock::LOCK_EXTENSION"; # Single process trying to count to $n my $n = 20; for (my $i = 0; $i < $n ; $i++) { # <-- we never see output after thi +s point in the code (Soren) my $lock = new File::NFSLock { file => $datafile, lock_type => LOCK_EX, }; sysopen(my $fh, $datafile, O_RDWR); # Read the current value my $count = <$fh>; # Increment it $count ++; # And put it back seek ($fh,0,0); print $fh "$count\n"; close $fh; } # Load up whatever the file says now sysopen($fh, $datafile, O_RDONLY); $_ = <$fh>; close $fh; chomp; # It should be the same as the number of times it looped is $n, $_; # Wipe the temporary file unlink $datafile;
I'm using CygPerl v5.40.3 (5.040003), on Windows 11. I am testing File::NFSLock 1.29. Do any of my good friends in the Cygwin camp here at Perlmonks get the same result? I checked RT @ cpan.org and didn't see any tickets that would apply to what's happening.
  — SorenI ran a test on my first system, that is, the one that the mentioned Bundle:: file came from; it's also Windows 11. The same CygPerl version. Guess what the result was ... yeah, the tests all passed. I have a significant amount to think about from the two (right now) replies below (thanks guys). But before immersion in NFS lore I thought I'd just try that. I have no theories at the moment. I will note, Alexander, that I don't recall ever choosing to install File::NFSLock on my computer. I think something I knowingly meant to install had a dependency on it.
Jan 18, 2026 at 22:04 UTC
A just machine to make big decisions
Programmed by fellows (and gals) with compassion and vision
We'll be clean when their work is done
We'll be eternally free yes, and eternally young
Donald Fagen —> I.G.Y.
(Slightly modified for inclusiveness)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Is getting locks on files with NFS broken on CygPerl?
by choroba (Cardinal) on Jan 17, 2026 at 20:08 UTC | |
|
Re: Is getting locks on files with NFS broken on CygPerl?
by afoken (Chancellor) on Jan 18, 2026 at 01:28 UTC |