procmail
[Top] [All Lists]

About locking

2010-02-05 22:20:11
I have a rule that collects the headers from mail and writes them to a
file. 

I want to trim this file periodically by way of a perl script and cron
job.

But not sure how to guarantee that I'm not interfering with a write
coming from procmail, or allowing procmail to interfere with the perl
scripts rewrite of the file.

I thought to copy the file to a new name, do whatever operations to
shorten it under the new name, then move it back to the original name.

How can I guarantee that last move doesn't interfere with a write
happening at the same moment.  Or will the underlying OS just do the
right thing?  (It will be on a linux box). 

____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)de
http://mailman.rwth-aachen.de/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>