Re: [EXIM] Locking a pipe

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Philip Hazel
Date:  
À: Jeffrey Goldberg
CC: exim-users
Sujet: Re: [EXIM] Locking a pipe
On Mon, 27 Jul 1998, Jeffrey Goldberg wrote:

> Exactly. Data from the mail piped to the command will be written to a
> file, and if I could avoid having to code locking into a what might
> otherwise be a very simple script, I would be pleased.


Of course, since (presumably) this script is the only thing writing to
the file, it has to lock only against itself, not against Exim or any
other program. If you don't have NFS to contend with, creating a lock
file should be fairly straightforward.

If (and it's a big IF) the script only writes to the end of the file,
and if all of its data can be written in a single write(), then you
don't actually need locking. Opening a file with O_APPEND will achieve
what you want, but maybe you can't do this easily from your script.

-- 
Philip Hazel            University of Cambridge Computing Service,
ph10@???      Cambridge, England. Phone: +44 1223 334714.



--
*** Exim information can be found at http://www.exim.org/ ***