Re: Java-made zip files can't be unzipped by the OS
Re: Java-made zip files can't be unzipped by the OS
- Subject: Re: Java-made zip files can't be unzipped by the OS
- From: Greg Guerin <email@hidden>
- Date: Tue, 19 Aug 2008 14:33:16 -0700
Florijan Stamenkovic wrote:
I am doing some archiving in Java. The produced zip files can not be
decompressed by the OS, though StuffIt can... I assume Java's
decompression would also work, though I have not tried it. OSX gives
an (Error 1 - Operation not permitted) message. Any idea why, and how
I can modify my code to produce zips that can be decompressed by
the OS?
The posted code neglects a close() of its ZipOutputStream before
returning from zip().
Zip-files have important information that comes after all the entries
are written, and if you don't call close() or finish(), that
information isn't written, so the zip-file is technically
incomplete. I suspect StuffIt is simply more tolerant of incomplete
zip-files, while the OS is more strict.
BTW, you can use the 'jar' command in Terminal.app to list contents
of a zip-file (jar simply being a kind of zip). You might want to do
this as a validity check. Read 'man jar'.
-- GG
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden