nmh-workers
[Top] [All Lists]

Re: [Nmh-workers] mhstore -clobber

2012-09-16 06:34:33
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.

_______________________________________________
Nmh-workers mailing list
Nmh-workers(_at_)nongnu(_dot_)org
https://lists.nongnu.org/mailman/listinfo/nmh-workers

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