Mantis - Squeak
Viewing Issue Advanced Details
1641 System minor always 08-10-05 20:59 02-24-06 21:18
ned  
 
normal  
closed  
fixed  
none    
none 3.9  
0001641: [ENH] Zip Serial Reading (was Re: [NIT] Managing repositories in MC)
On Sunday 21 September 2003 03:08 pm, Avi Bryant wrote:
> 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.

So why not store the version first?

> 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.
> ....

No, that should work, assuming that the zip was stored correctly. All
the data is there in the headers, which precede the members
(usually).

Enclosed is a CS that will add serial reading support (header by
header) to the existing ZipArchive stuff.

It hasn't been tested, and I couldn't find any support for the HTTP
byte-ranges in the image.
 ZipSerialReading-nk.1.cs.gz [^] (1,385 bytes) 08-10-05 21:05

Notes
(0002233)
KenCausey   
08-10-05 21:02   
Avi Bryant <avi@beta4.com>:

"> > Unfortunately, the very first member of a .mcz file is the package
> > name, not the ancestry info.
>
> So why not store the version first?

Because there are already a bunch of .mcz files out there in the current
format.

> Enclosed is a CS that will add serial reading support (header by
> header) to the existing ZipArchive stuff.

Very cool, thanks.

> It hasn't been tested, and I couldn't find any support for the HTTP
> byte-ranges in the image.

No, I wouldn't have expected there to be. HTTP client support is
currently minimal, to say the least. That's something I've been meaning
to work on for a long time."
(0002234)
KenCausey   
08-10-05 21:06   
denker@iam.unibe.ch:

"Checking ZipSerialReading-nk.1.cs (#5420) for method conflicts with
changesets after 5420advanceToGammaOr37-dew ...
...checking ZipFileMember>>readLocalDirectoryFileHeaderFrom:
CONFLICT found for ZipFileMember
class>>readLocalDirectoryFileHeaderFrom: with newer changesets
5994-004-systemMod 5996-006-incChanges
...checking ZipFileMember>>readFrom:
1 conflict found."
(0002235)
KenCausey   
08-10-05 21:07   
I loaded this into 3.8-6665-basic without errors but did not test it further.
(0004058)
MarcusDenker   
02-24-06 21:18   
rejected. Conflicts indicated, author did not react --> not important. closed.