From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <640302a69bf28aee719ac6561af7be50@quanstro.net> From: erik quanstrom Date: Fri, 19 Dec 2008 09:21:02 -0500 To: 9fans@9fans.net In-Reply-To: <4bdece4cd73b46e7fe957da67fa215c6@plan9.bell-labs.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: Re: [9fans] 9pfuse and O_APPEND Topicbox-Message-UUID: 6a4f2526-ead4-11e9-9d60-3106f5b1d025 > 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