Commit Graph

12 Commits

Author SHA1 Message Date
Jeremy Stanley 9e144061b9 fix modifying existing zipfile with zip64 enabled
The local header size computed from the central directory entry
is incorrect due to the Zip64Placeholder in the local entry.
This caused us to seek to the wrong location when copying an
unchanged compressed data stream.

(The same problem could occur when modifying any zip file where
the local header and central directory header contain different
variable-sized fields, so it's a good idea not to trust the CD
to tell us the local header size in any case.)
2014-03-12 15:57:52 -06:00
Alexander Simonov 2697c7ea4f Fix #138 2014-03-09 20:38:24 +02:00
Sam Rawlins a37e13c6f0 File.exists? -> File.exist? 2014-02-06 15:00:38 -08:00
Alexander Simonov ec81c30382 Fix for #126 and #127 2014-01-24 11:37:38 +02:00
Alexander Simonov c7f0b17abf Real fix for #119 2014-01-19 13:45:58 +02:00
Alexander Simonov 18506c6345 Fix #119 calling 'path' on not IO objects 2014-01-06 20:29:39 +02:00
Jeremy Stanley af165f5cbd Add read/write support for zip64 extensions
This commit adds the capability of creating archives larger than
4GB via zip64 extensions. It also fixes bugs reading archives of
this size (specifically, the 64-bit offset of the local file
header was not being read from the central directory entry).

To maximize compatibility, zip64 extensions are used only when
required. Unfortunately, at the time we write a local file header,
we don't know the size of the file and thus whether a Zip64
Extended Information Extra Field will be required. Therefore
this commit writes a 'placeholder' extra field to reserve space
for the zip64 entry, which will be written if necessary when
we update the local entry with the final sizes and CRC. I use
the signature "\x99\x99" for this field, following the example
of DotNetZip which does the same.

This commit also adds a rake task, zip64_full_test, which
fully tests zip64 by actually creating and verifying a 4GB zip
file. Please note, however, that this test requires UnZip
version 6.00 or newer, which may not be supplied by your OS.
This test doesn't run along with the main unit tests because
it takes a few minutes to complete.
2013-09-27 20:41:00 -06:00
Alexander Simonov 73d9e1c8a0 StingIO support #47 #18 2013-08-29 23:50:12 +03:00
Alexander Simonov 609de2ff48 Zip64 read-only support. Fix #81 2013-08-26 23:26:14 +03:00
Alexander Simonov 317fdd0d04 Add posibility to set Language encoding flag. Changed way to set settings. 2013-08-15 01:00:27 +03:00
Alexander Simonov 20d79feb99 Refactor ::Zip::Entry and ::Zip::ExtraField 2013-06-30 23:52:48 +03:00
Alexander Simonov 61ce5dbc5f Refactoring part #2
Rubyzip interface was changed!
2013-06-03 10:56:24 +03:00