http://qs321.pair.com?node_id=632775


in reply to Archive::Zip Problem: Zip versus Jar file formats

Hi

The Archive::Zip module will not compress members if the uncompressed size is 0. However, the jar command seems to add an additional "external local header" to the data.

So, when A::Z writes out the data, since it thinks it's 0 bytes, it writes out uncompressed, but also writes ou the external header(?), giving you the "only DEFLATED entries can have EXT descriptor" error.

This link seems to show something similar in python that might have some insights:

http://mail.python.org/pipermail/python-bugs-list/2007-June/038900.html

I tested this with A::Z v1.20, and I think it's a bug with A::Z. I was poking around in A::Z::Member::rewindData to see what it does with 0 byte compressed data.

Also, running zip against the file gives:

>zip bar.jar zip warning: extended local header not found for META-INF/ zip error: Zip file structure invalid (bar.jar)
Hope this helps, Jim