rubyzip problem with local header magic

R

Robert Evans

Hi,

I was using the rubyzip library (v0.5.12 on OS X 10.4) to read some
zips created by Java's ZipOutputStream (Java 1.5) classes.

The zip can be completely read by every tool out there, except
rubyzip. rubyzip reads the first zip_entry just fine, but then raises
an error with the message "local header magic not found."

So, it looks like it cannot distinguish the local header magic number
used by the Java classes. I notice it can read zips with multiple
entries created by its own ZipOutputStream. I also noticed that the
local header magic number is different than the one that rubyzip uses
for subsequent entries

Any help is greatly appreciated

Thanks,
Bob Evans
Agitar Software
 
K

Katarina WONG

Hi,

I was using the rubyzip library (v0.5.12 on OS X 10.4) to read some zip= s =20
created by Java's ZipOutputStream (Java 1.5) classes.

The zip can be completely read by every tool out there, except rubyzip.= =20
rubyzip reads the first zip_entry just fine, but then raises an error =20
with the message "local header magic not found."

I have experienced the same kind of trouble with ZIP files from various
sources (archivers), now I seem to have found an approach compatible with
all the ZIPs I could find. (Not tried any ZIP created by MacOS though)

Can you post here a small ZIP file created by JAVA, I will have a look ?


--=20
Katarina
 
T

Thomas Sondergaard

Robert said:
Hi,

I was using the rubyzip library (v0.5.12 on OS X 10.4) to read some
zips created by Java's ZipOutputStream (Java 1.5) classes.

I think the problem is that ZipInputStream is slightly broken - it does
not support ZipFiles created with DataDescriptors trailing each entry.
It should be very simple to fix, but I don't have time for it now. If
this is indeed the problem it can be circumvented by using the ZipFile
class, which reads the zip central directory structure, and use that to
iterate through the entries.

Sorry for the inconvenience

Thomas
 
R

Robert Evans

Hi Thomas,

Thanks for the tip, and thanks again for writing rubyzip. I'm not
inconvenienced at all :)

Bob Evans
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top