[NIT] Managing repositories in MC

Avi Bryant avi at beta4.com
Sun Sep 21 22:08:40 UTC 2003


On Sun, 21 Sep 2003, Ned Konz wrote:

> If you store the version info as the first member of the zip (either
> compressed or not) you can just grab the first packet's worth of
> bytes (1K or so). You will get the member header preceding it, which
> you can examine to make sure you have all the bytes.

Thanks, Ned.  I seem to be able to get the first member from a zip file by
doing this:

n := 'Foo.mcz'.
f := FileStream readOnlyFileNamed: n.
f binary.
z := ZipArchiveMember newFromZipFile: f named: n.
z readLocalDirectoryFileHeaderFrom: f.
z contents.

Unfortunately, the very first member of a .mcz file is the package name,
not the ancestry info.

Is there anything about the zip format that would prevent an interface
like the code below, without needing the central directory?

z := ZipArchiveStream on: aStream.
aMember = z nextMember.
anotherMember = z nextMember.
....



More information about the Squeak-dev mailing list