Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
How does *NIX MBOX deal with data? Would the way it does it, offer some interesting methods.

Are you refering to "the" mbox mail box file format? (See Wikipedia, qmail.org, Jonathan de Boyne Pollard, RFC 4155)

Well, actually, there are serveral slightly incompatible formats, and they all are essentially append-only formats. A variant is used by Netscape's Communicator and its derivates (Thunderbird, Seamonkey). It has a separate index file containing the file offsets of the e-mails in the mbox file and some other data. "Compacting" the mailbox just rewrites the entire mbox file, omitting all e-mails flagged as deleted. (See http://www.jwz.org/doc/mailsum.html.) Mail servers using the mbox format probably do something similar. I remember one old server at my university that kept a special first message in the mbox files, invisible via POP3 and IMAP. Parts of this message were constantly overwritten to keep track of changes to the mbox file. I think that some of my old linux machines behaved the same until I've switched to imapdir several years ago.

So, perhaps the only useful ideas from mbox are a second file containing a list of file offsets into the main file, and a special (fixed size) directory record at the beginning of the main file.

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

In reply to Re^5: Quick Question - Append File at Beginning? by afoken
in thread Quick Question - Append File at Beginning? by jdlev

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others browsing the Monastery: (5)
    As of 2014-09-17 02:09 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      How do you remember the number of days in each month?











      Results (56 votes), past polls