• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Java-made zip files can't be unzipped by the OS
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: Re: newbq-why can i not dwld-verify any applications on my iphone?
  • Next by Date: kext and std C++ algorithms?
  • Previous by thread: Re: nsbutton mouseEntered event is not working
  • Next by thread: kext and std C++ algorithms?
  • Index(es):
    • Date
    • Thread