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
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 ?
···
On Thu, 29 Sep 2005 20:20:21 +0200, Robert Evans <robert.evans@acm.org> wrote:
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."
--
Katarina
Robert Evans wrote:
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
Hi Katarina,
I found out from Thomas the creator of rubyzip that there was an issue, he sent along a fix that helped, though it hasn't solved all of my issues. I am still not getting the entry even though now it finds the magic number.
Here is a zip made with java.
Bob
demo.zip (1.21 KB)
Hi Thomas,
Thanks for the tip, and thanks again for writing rubyzip. I'm not inconvenienced at all 
Bob Evans
···
On Sep 30, 2005, at 12:51 AM, Thomas Sondergaard wrote:
Robert Evans wrote:
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