procmail
[Top] [All Lists]

Re: how to deliver to a file with a unique time-stamped file name, reliably?

2005-01-20 04:14:04
On Thu, 20 Jan 2005, Robert Allerstorfer wrote:

On Wed, 19 Jan 2005, 16:21 GMT+02 Udi Mottelo wrote:

On Wed, 19 Jan 2005, Robert Allerstorfer wrote:

 av_ID
 :0
  {
     av_ID = `date +"%Y%m%d-%H%M%S.%N"`
     # eg. "20041203-163017.405974000" or "20041203-163017.N"
     # If %N (nanoseconds) has been supported, strip its last 3 digits
     #    (probably only zeros); otherwise use the 5-digits PID

     :0
      * av_ID ?? ^^\/........-......\.......
      {
         av_ID = $MATCH
         # eg. "20041203-163017.405974"
         #                      ^^^^^^
         #                      6-digits microseconds
      }

     :0 E
      {


        What will you do if the subject is "HaloDear-Sancho.Pancho"?

The subject has nothing to do with $av_ID, which will originally equal
to a string like

        Uf, Sorry.

'20050120-011239.200542000' and then be cut to
'20050120-011239.200542'.


MYDATE=`date '+%y%m%d%H%M%S'`.$$

        It will be uniq.

The `date +"%Y%m%d-%H%M%S"` part I am using is basically the same, but
uses 4-digits for the year, which I am prefering over your 2-digits
format.

        You format is much readable but I prefer not to break the
        date field because of some cases when I want to play with
        it, for example to check  If T1 is bigger then T2.


Also, I don't think using all-UPPERCASE characters for a variable name
is a good idea since there is no way to distinguish such variables from
procmail's built-in ones. If a custom variable always begins with
a lowercase character, then we are prepared when an updated procmail
version introduces a new variable which then could theoretically match
exactly (should there ever be a new procmail version).

        Right

Bye,
 Udi


rob.


____________________________________________________________
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>