On Thu, 14 Apr 2011 10:23:29 -0700 (PDT) Donn Cave <donn@xxxxxxxxxxx> wrote: > In a more interesting case, if I know that the message has a MIME > multipart structure, I may "seek" to a certain spot in the file > to read a certain part, and then the filesystem would download > that whole part. You have to publish the data for that structure - > offset, size, MIME type of each part - in file attributes or > something (note that structure is recursive, by the way!), so > I would know where to seek. (And we need to test the assumptions > vs. server implementations and make sure that data is reliable > and not compromized by differences in the way part sizes are > reported, separator sizes, etc.) > > If it isn't feasible to support random access as described > above, it still makes sense to support incremental download > for sequential access. You don't need to download a part until > I have asked to read it. If I read "off the end" of the cached > data, but still inside the extent of the file as reported by > RFC822.SIZE, then it's time to fetch more parts. I don't have > to know the MIME structure of the file to do this, and of course > I don't have to communicate it to the filesystem as such, I just > ask for N bytes of data at file offset T. > > I think it will still be desirable to publish MIME structure, > though, since applications need to know this, and I think you > really have to support seek anyway, so maybe it boils down to > the same implementation either way. If the difference is > whether parts could be incrementally cached out of order, maybe > that isn't such a good idea anyway, since the part boundaries > won't line up with the block structure of the cache device. > Just guessing on that. From a brief look at a few example multipart mails in my inbox, there isn't any kind of table of contents referring to the parts; they are simply separated by a boundary string. So to be able to publish the internal structure of the mail one would have to parse it completely, which means downloading it completely. I don't think this kind of pre-parsing of mail content belongs in the file system, anyway. CU, Ingo