dmdz

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Thu Mar 18 15:52:30 PDT 2010


On 03/18/2010 05:32 PM, Michel Fortin wrote:
> On 2010-03-18 18:17:26 -0400, Andrei Alexandrescu
> <SeeWebsiteForEmail at erdani.org> said:
>
>> On 03/18/2010 05:11 PM, Walter Bright wrote:
>>> Andrei Alexandrescu wrote:
>>>> The basic interface is:
>>>
>>> Another thing needed for the interface is an associative array that maps
>>> a string to a member of the archive. Object code libraries do this (the
>>> string is the unresolved symbol's name, the member is of course the
>>> corresponding object file).
>>
>> Emphatically NO. Archives work with streams. You can build indexing on
>> top of them.
>
> Andrei, have you took a look at the Zip file format? It's not streamable.
>
> To be exact, zip is not streamable because you need to read the central
> directory at the end of the archive to get the actual file list. This
> has its benefits: it makes it easy to peak at the content without
> loading everything, and it makes it possible to completely change the
> archive's logical content just by appending to the file. It's like a
> mini-database in a way.
> <http://en.wikipedia.org/wiki/ZIP_(file_format)#Technical_information>
>
> I agree it is essential to have streaming support for archives formats
> that works with streaming. But offering only that is not a solution for
> archives in general.
>

Interesting, thank you. I still think generally a random-access 
interface is not the charter of the Archive interface. A zip archive 
should open the archive, seek to the end of it once, build an index, and 
then rewind the file for sequential access. But we shouldn't ask for 
such miracles from all archives.

Andrei



More information about the Digitalmars-d mailing list