When I wrote,
Unfortunately, however, that does the job only if the file exists. If the
file *doesn't* exist, lockfile creates it, and then I need an additional
fork for rm to remove it.
| (Unexpert interupt) if you lock something you must unlock too,
That's what I just said: if you create a lockfile you have to remove it.
Then Andrew pointed out how lockfile could be tricked into removing it.
| The lockfile timeout on the order of secunds!
The timeout doesn't apply here. lockfile -r0 tries once and then quits. On
the other hand, what if the file hasn't been used in a while ... wouldn't
lockfile consider it stale and remove and re-create it?
Anyway, head is lighter than lockfile, so the discussion of using lockfile
was just a sidelight.
procmail mailing list