SAR

Ned Konz ned at bike-nomad.com
Wed Nov 20 16:45:06 UTC 2002


On Wednesday 20 November 2002 06:35 am, Stephen Pair wrote:
> I have not had any problems using WinZip with an archive that
> contains Squeak code at the front of it.  So I don't think that
> physically having something there will hurt anything.

You have to be careful with Zips if you want them to be valid. The 
Central Directory (at the end of the zip) has actual file offsets in 
it; these are invalidated by prepending data. My "write prepending 
file" operation in Squeak fixes these file offsets.

What WinZip does (and also the Info-Zip libraries that it uses, and 
also my Perl Archive::Zip package) is to use the redundant header 
information in Zips to account for improperly prepended stuff. 
(sidenote: I had to add that to Archive::Zip because there were 
viruses which were prepending themselves to zips and 
self-extracting-zip .exe files and the Amavis virus scanner uses 
Archive::Zip).

> Perhaps the approach should be to change the Squeak file-in
> mechanism with this capability in mind.  You could make it so that
> your file-in code has access the relevant information without
> needing to do hacky things like Craig had to do (ie. have
> "installer" variable bound to the installer, give access to the
> directory and file name that you're filing in, provide some
> framework for making it simple to access the members of a zip file,
> etc).

Look at the code in SARInstaller for 
PositionableStream>>fileInFor:announcing: which lets you set "self" 
for the context of the file in. This can be used for other installers 
(in fact, for the generic Squeak file-in operation as well).

> So, I'd say let's make the file-in mechanism a little more
> intelligent to accomodate zip archives and that would benefit
> anyone wanting to distribute Squeak stuff in an easily loadable zip
> file.  BTW, I've often wanted to access the file name in a
> file-in...so I think there are some other benefits to be had in the
> file-in process in general.

The only concern with this is backwards compatibility. If you're not 
worried about this, it's easy to fix going forward.

-- 
Ned Konz
http://bike-nomad.com
GPG key ID: BEEA7EFE




More information about the Squeak-dev mailing list