[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Nmh-workers] mhstore -clobber
From: |
Ralph Corderoy |
Subject: |
Re: [Nmh-workers] mhstore -clobber |
Date: |
Sun, 16 Sep 2012 12:34:23 +0100 |
Hi David,
> > > With auto and suffix, n is one beyond the existing file with the
> > > highest number in the same form.
> >
> > I think it's more that n is the first number from 1 that isn't
> > already used? So with foo.{1,2,3,9} it's foo.4.
>
> You're right. As you might expect, the code just just iterates up
> from 1 until stat(2) finds the first opening.
Strictly speaking, I wonder if it should be attempting to open(2) each
contender with O_CREAT | O_EXCL until one succeeds, at which point it
has the file descriptor to use. Unlikely to be an issue with
interactive use but perhaps with some procmail-type handling?
Cheers, Ralph.