Alan Stewart
Fri, 26 Sep 2003 20:13:24 -0700
On 26 Sep 2003 at 16:41, Karl Forner wrote:
> Alan Stewart wrote:
>
> >I see this problem also, running InfoZip/ActiveState/Archive::Zip
> >1.06/Compress::Zlib 1.16.
> >
> >If I use:
> >
> > zip -r hello.par my_dir
> >
> >then InfoZip, by default, adds a zip directory entry for my_dir/ and for
> >my_dir/datafile. Something blows up using Archive::Zip when the my_dir/ entry
> >is there. If I use:
> >
> > zip hello.par my_dir/datafile
> >
> >all is ok, or if I use:
> >
> > zip -r -D hello.par my_dir/
> >
> >so InfoZip doesn't add the my_dir/ zip entry, all is fine. Most GUI zippers
> >apparently don't add entries for file directories by default.
> >
> >The sample zip programs that come with Archive::Zip have no problem with the
> >my_dir/ entry, so I don't know if this is an Archive::Zip bug or a Par bug.
> >
> >At least "zip -r -D" avoids the problem.
> >
> >Alan Stewart
> >
> >
>
> Thanks a lot ! zip -r -D works. What's strange is that it it seems that
> the Archive::Zip::addTree method leads to the same problem.
> Karl
>
According to the docs, Archive::Zip::addTree also adds files and idrectory
entries by default, but you can use:
$zip->addTree( $root, $dest, sub { -f } )
to eliminate the directory entries, similar to "zip -D".
Alan Stewart