procmail
[Top] [All Lists]

Re: actual problem. (that millisecond thing)

2002-06-13 10:26:08
At 14:34 2002-06-13 +0530, Ali, Imran did say:
Thanx for ur answers and sorry for spams that i have caused.

Add "constantly changing subject" to the list. It's difficult to glance at subjects and tie them together when the subjects change for the SAME TOPIC.

  Now if two mails come simultaneously. It is overwriting the /tmp/mail ,
and thus my script gets confused and didn't work. To solve this I tried to
store mail as /tmp/$TIME which i am getting from DATE , in this hope that
even if two mails come consecutive second, it will store them in separate
files.

Yea, explaining your goal is much better than just insisting on a precision time thing.

Each invocation of procmail will have a unique PID - and certainly any two concurrently running processes will have unique PIDs.

        LOG="Procmail PID is $$"

:0 c
| EX_SCRIPT -w ........$WHOFROM ............../tmp/$TIME .........

perhaps your external script could use 'tempnam' 'tmpfile' 'tmpnam' 'mkstemp' 'mktemp', which all create "unique temporary filenames".

Barring that, try:

tmpname=/tmp/newmail.$$

Or:

tmpname=/tmp/newmail.$$.`perl -e "print time;"`

Presuming you delete the temp files and don't need to use them multiple times within the same invocation (or at least delete them between uses), these should be unique enough.

You could alternatley use perl or C to use a temp name function to create the file and emit the filename, which you could then use -- AND DELETE.

---
 Sean B. Straw / Professional Software Engineering

 Procmail disclaimer: <http://www.professional.org/procmail/disclaimer.html>
 Please DO NOT carbon me on list replies.  I'll get my copy from the list.

_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>
  • Re: actual problem. (that millisecond thing), Professional Software Engineering <=