<<< Date Index >>>     <<< Thread Index >>>

Re: curious about some implementation issues



On Friday, October  3 at 03:08 PM, quoth Sergei Gerasenko:
1) If I understand correctly, marking a message as "read" involves inserting a "Status:RO" line into the header of the message.

That's only true of messages stored in mbox and MH format mailboxes. Maildir mailboxes store that information in the name of the message file.

How does mutt do that pricesely? I mean, is it modifying the file in place or does it create a temporary file, which is then renamed?

In my experience, it seems to be the latter...

2) How does mutt make sure that while it's modifying the mailbox, the delivery agent is not adding something to it at the same time?

In the case of mbox, the mailbox is locked using the dot-lock program. The exact method used depends on the filesystem... the fastest method is an fcntl lock, but NFS sometimes doesn't have a functional lock protocol, so dot-lock files are created. You can read a more detailed explanation of what goes on in general on Wikipedia: http://en.wikipedia.org/wiki/Mbox

~Kyle
--
They say marriages are made in Heaven. But so is thunder and lightning.
                                                     -- Clint Eastwood

Attachment: pgpC47a_WkA6u.pgp
Description: PGP signature