[ENH] DropFilesOnArchiveViewer-as-nk ( path name choices )

Ned Konz ned at bike-nomad.com
Fri Apr 23 13:06:15 UTC 2004


On Friday 23 April 2004 1:32 am, Jason Rogers wrote:
> On Fri, 2004-04-23 at 01:07, Ned Konz wrote:
> > That is (assuming the default directory is '/home/ned/Squeak'):
> > ...
> > - if you drop a directory named: '/home/ned/Squeak/xyz/abc' containing a
> > file named 'def' then the resultant file will be called 'xyz/abc/def'.
> > - if you drop a directory named: '/home/ned/xyz/abc' containing a file
> > named 'def' then the resultant file will be called 'xyz/abc/def'.
> > ...
>
> Are these two correct?

That's the way it is now. Do you think it should be some other way? The 
previous behavior of 'add a directory' was to strip off the directory name 
(thereby flattening it); if you added the same directory named 
'/home/ned/Squeak/xyz/abc' containing a file named 'def' then the resultant 
file would have been called 'abc/def'. A file called 
'/home/ned/Squeak/xyz/ghi.jkl' would have been called 'ghi.jkl'.

But I found that when building SAR files manually that it was more useful to 
make 'subdirectories' to help organize things. This way if you were unzipping 
it somewhere the files wouldn't end up all in the same directory.

> I would think that you would end up with these 
> two files in the archive:
>
> 1. /home/ned/Squeak/xyz/abc/def
> 2. /home/ned/xyz/abc/def

First, you should *never* have absolute paths in a Zip file. Not only is this 
against the spec, it's a bad idea for security reasons (though I suspect most 
Zip programs ignore the leading slash anyway).

Second, I'm trying to provide the most useful behavior here. Since zips are 
used to move files between systems (like the SAR and the project format in 
Squeak, for instance), absolute paths to places on my system aren't too 
important.

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



More information about the Squeak-dev mailing list