Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!swrinde!ucsd!ucbvax!THUMPER.BELLCORE.COM!nsb From: nsb@THUMPER.BELLCORE.COM (Nathaniel Borenstein) Newsgroups: comp.soft-sys.andrew Subject: Re: .MS_MsgDir Message-ID: Date: 28 Nov 89 14:52:38 GMT References: <19996@pasteur.Berkeley.EDU> Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 23 First of all, the date field: This is a UNIX-style date (seconds since January 1, 1970, or something like that) converted from a long into a base 64 string of six bytes. The AMS libraries contain functions for going into and out of base64, but of course that won't help you if you're not using C; the code for them is in overhead/mail/lib/genid.c, and should be easily converted to some other language. (The rationale for the base 64 stuff is lost in ancient history, but had to do with wanting to put the dates in ASCII-readable form for things like file names, etc. In retrospect, I don't care to defend it.) The header part of the .MS_MsgDir file is basically a magic signature and some directory-wide information. Included in it are a major and minor version number for the format of the .MS_MsgDir file itself. That format hasn't changed for years, and probably won't change any time soon, but checking it is a good idea in case it changes some time in the future. The actual format of the header is fairly idiosyncratic, but easily understood if you know where to look. The place to look, it turns out, is in ams/libs/ms/rawdb.c, in a routine called DestructivelyWriteDirectoryHead. That routine is what normally writes out the directory headers, and it should be pretty easy to tell, from that, what the format is. (No, there is no formal spec anywhere for the format.) I hope that helps; if you need further help, don't hesitate to ask.