> The places that DMAPPEND is used most commonly are log files and mail
> boxes.

mailboxes are append only, however
deleting a message requires rewriting
the mailbox, which isn't possible.  so
a temporary mbox is written, has its
mode tweaked and then replaces the
mbox.  L.mbox is exclusive open and
locks the whole directory to prevent
accidents.

since each message is in its own file,
mdir uses atomic create(2) (OEXCL)
for delivery.  deleting is trivial.  no
L.mbox required.

back to the subject.  i agree with the
point mixing append-only and regular
fids would be a disaster.  this is because
(in general) it takes multiple writes to
accomplish one's goal.  in the case of
a mailbox, it would not be safe to be
adding a new message while rewriting
to delete messages.  an exclusive-open
file would make much more sense.

log files are the big exception, of
course, nobody cares if the entries
are reordered, as long as they remain
intact.  and since each entry is smaller
than the iounit (syslog uses a 1k
buffer), the can fit into a single write
and can be ordered.

- erik

Reply via email to