ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jesse Glick <Jesse.Gl...@netbeans.com>
Subject Re: Zip task including dirs
Date Thu, 07 Sep 2000 13:39:47 GMT
donaldp@mad.scientist.com wrote:
> 
> On Wed, 6 Sep 2000, Will Glozer wrote:
> 
> > Hello, I am wondering why the Zip (and thus Jar) tasks include all of the
> > parent
> > directories for each file?  It seems that the file would just need its full
> > path,
> > and not a separate zip entry for the directory itself.  This would make
> > viewing
> > the archives much easier and possibly even reduce their size.
> 
> I like that behaviour and need it or else I end up creating
> files in directories that's sole purpose is to ensure that
> dir gets created. I have done this a lot with OS level zip
> utilities and it suxs :<.

I sent the patch that ensures directories are added fairly recently and
it was committed. It is more consistent with the behavior e.g. of the
JDK jar tool, which always creates the parent dirs, and at least Linux
zip. It seems safer to put them in even if it does make a few more
entries in the archive; some readers of the archive may blithely assume
that parent dirs exist (as happened to me).

Note: the current Zip.java does not add directories that have no file in
them, even if they matched according to the fileset. I.e. it looks for
matching files only, then adds just their parents. This is arguably a
bug; I will try to send a patch to fix it if anyone is interested.

> An optional attribute that turned of this behaviour would be
> okay thou :P

This would be really easy if people wanted it--just add a new attribute
to Zip.java, and if set, then in zipDir() return without doing anything.
Again I will send a patch if there is interest.

-Jesse

-- 
Jesse Glick   <mailto:Jesse.Glick@netbeans.com>
NetBeans, Open APIs  <http://www.netbeans.org/>
tel (+4202) 3300-9161 Sun Micro x49161 Praha CR

Mime
View raw message