Christian Schwarz <[EMAIL PROTECTED]> writes: > AFAIK, the only way to lock a file (even reliable over NFS) is to create > another file with a unique filename, e.g. foo.lock-ipaddress-processid, > and create a link say to foo.lock. The "link" function is atomic per > definition, even via NFS and will fail if the file already exists. Is this > correct?
Almost. link(2) is atomic, but it can fail and still return a succesful return code. It's necessary to check the file with stat(2) afterwards. Guy -- TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to [EMAIL PROTECTED] . Trouble? e-mail to [EMAIL PROTECTED] .