Whether you can reliably lock a file over NFS depends on
the implementation of NFS on the involved systems. In
general, you should avoid using locking over NFS - it's
certainly not going to be portable.
Abigail
Comment on Re: Exclusive locking of a file on an NFS filesystem