On Sun, 21 Jun 1998, Edward Roper wrote:
: Perhaps someone has or can point me towards a link that would contain C code
: to accomplish the following:
: - Check a users mailbox for an existing lock. If so, keep trying.
: (sendmail lock style)
: - If no lock exists, lock the file
: - Unlock the file when done.
: Obviously I can go dig through sendmail, pine, mutt, elm code but there is a
: lot of extra code in there to complicate the procedure. I'm looking for minimal
: code.
There is a library, ported from Solaris IIRC, that implements even safe file
locking over NFS, and it certainly can be used for mailbox-locking too. This
library is called liblockfile - I think you can find it in any Debian mirror
near you.
bye,
-Remco