Menu ▾ ▴

#38 ZipFile::open on an existing zip file corrupts it

open
nobody
5
2012-07-18
2011-06-17
Tom Abraham
No

Opening an existing zip file with ZipFile::open according to the documentation (http://rubyzip.sourceforge.net/classes/Zip/ZipFile.html) with the ZipFile::CREATE flag and then using it corrupts it. (No, it doesn't clear its contents or delete it--it outright corrupts it.) Works correctly without the ZipFile::CREATE flag.

On Mac OS X 10.6.7 on a MacBook Pro 7.1.

The fix should be as simple as setting the local variable 'create' in ZipFile's new method to nil if File.exists?(fileName) is true.

Discussion

  • Tom Abraham

    Tom Abraham - 2011-06-17

    Fix patch to zip.rb

     

Anonymous
Anonymous

Add attachments
Cancel