If you are trying to lock a file that's on NFS create a file in a local directory (/tmp perhaps) and do the locks on that file to control access to the NFS file. | [reply] |
Assuming, of course, that the script is only run on one machine. Nitpicking? Yes. :-)
| [reply] |
| [reply] |
locking over NFS is usually pretty sketchy regardless of wether it's a lock on a file or a directory. Unix really doesn't make a huge distinction between a file and a directory anyway, so the atomicness (I love making up words) of a lock on a file vs. directory should be the same.
There are some NFS server appliances that don't use a unix file system (NetApp for one) where the atomicness may differ a bit.
It's been quite a long time since I've played with anything other than sharing home directories on NFS so some of my thinking is most likely dated. :)
| [reply] |