Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: NFS locking with Fcntl

by Preceptor (Deacon)
on May 10, 2016 at 11:25 UTC ( [id://1162620]=note: print w/replies, xml ) Need Help??


in reply to NFS locking with Fcntl

Of course, shortly after posting - I found the answer, in this answer

use strict; use Fcntl qw(SEEK_SET F_WRLCK F_UNLCK F_SETLKW); my($pack); open(FILE,">a"); $pack = pack('s s l l s', F_WRLCK, SEEK_SET, 0, 1, 0); print(fcntl(FILE, F_SETLKW, $pack) . "\n"); sleep(20); $pack = pack('s s l l s', F_UNLCK, SEEK_SET, 0, 1, 0); print(fcntl(FILE, F_SETLKW, $pack) . "\n"); close(FILE);

This worked for me on my Linux implementation, to test whether locking over NFS works.

Replies are listed 'Best First'.
Re^2: NFS locking with Fcntl
by QM (Parson) on May 10, 2016 at 12:43 UTC

      Nor I. However, my requirement isn't to use it, it's to test whether it actually works at all. Further test may follow.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1162620]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (5)
As of 2024-05-29 05:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found