Manipulating ZIP files - Compress::Zlib not too helpful 
Author Message
 Manipulating ZIP files - Compress::Zlib not too helpful

Hello,

I've tried to figure out how to use Compress::Zlib to manipulate ZIP
files, and with the two measly lines in the documentation discussing ZIP
I'm lost.

It appears that the only thing really supported by Compress::Zlib and
Zlib itself is the compression of the file streams, not anything to do
with the ZIP file header itself. The documentation also seems to assume
that only one file will ever exist in an archive (like with gzip files).

I'd like to avoid issuing a bunch of "system" calls to manipulate ZIP
files with an external program (such as zip/unzip or pkzip/pkunzip), and
instead have a module or library I can load into memory to open a ZIP,
grab a list of the files in a ZIP, find the file I want via regex,
decompress it, alter the file, and then recompress it back into the
archive.

I'm not savvy enough to try to write my own ZIP header parser in the
amount of time I need to complete this project.

Does anyone have any examples of using Compress::Zlib to manipulate zip
(pkzip compatible) archives or know of any C routines/libraries that can
be called from Perl that know how to operate on ZIP files?

Thank you very much for your time and expertise. It is appreciated.

--James



Sun, 04 Aug 2002 03:00:00 GMT  
 Manipulating ZIP files - Compress::Zlib not too helpful


[...]

Quote:

> It appears that the only thing really supported by Compress::Zlib and
> Zlib itself is the compression of the file streams, not anything to
> do with the ZIP file header itself.

You are correct. Compress::Zlib is just a translation layer so you can
call the functions in the Zlib (libz) library from Perl. It has
everything that Zlib has, but no more.

There's been some work to reimplement Zip and Unzip using Zlib, but
it's not complete (as far as i know). There is, however, a couple of C
programs which come with the source code for Zlib, which implement a
subset of Zip and Unzip. If you are brave, it should be possible
to "translate" them from C to Perl. If you do, please post it to CPAN...

Here's Zlib's home page:
http://www.cdrom.com/pub/infozip/zlib/

If i remember right, you'll find what you're looking for under
the "minizip" directory, under the "contrib" directory.

Good luck!

glauber

--
Glauber Ribeiro

"Opinions stated are my own and not representative of Experian"

Sent via Deja.com http://www.deja.com/
Before you buy.



Mon, 05 Aug 2002 03:00:00 GMT  
 Manipulating ZIP files - Compress::Zlib not too helpful
There is a module to do this. Look on CPAN for:
Archive::Zip    (N/NE/NEDKONZ/)
Archive-Zip-0.07.zip

HTH,
  soren andersen

* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!



Mon, 30 Sep 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. downloading and extracting zip files from the Web using LWP and Compress::Zlib

2. Compress::Zlib and zip files

3. make test for Compress::Zlib gives Ordinal 3 not found in zlib.dll

4. How do you compress an entire file with Compress::Zlib

5. URGENT: about zlib and Compress-Zlib

6. Compress::Zlib and zlib location

7. installing compress-zlib and zlib-1.1.3

8. Compress::Zlib missing header files?

9. Can you decompress .Z files with Compress:ZLib?

10. pkzip files with Compress::Zlib??

11. pkzip files with Compress::Zlib??

12. Using Compress::Zlib to decompress files

 

 
Powered by phpBB® Forum Software