Commit graph

34 commits

Author SHA1 Message Date
Alexander Bulaev
fee626ba59 Control backend choice of flate2 2018-05-19 20:03:23 +03:00
Mathijs van de Nes
5e8c95e6ed Make santized_name part of the library
It is a common pitfall to use the name as-is during extraction. Adding
this function may prevent some of the issues.

Resolves #65
2018-04-20 13:35:20 +02:00
Mathijs van de Nes
fce3836059 Better handling of zips with invalid datetimes
The msdos datetime 0x00000000 is invalid. The Windows API would
(rightfully) return an ERROR_INVALID_PARAMETER for this when converting
it. If it is indeed an invalid error, we now return the zip datetime
'epoch' of 1980-01-01 00:00:00.

Resolves issue #61
2018-02-17 20:05:09 +01:00
jhwgh1968
7c2d4e2901 Named the deflate algorithm feature gate "deflate" 2018-01-07 13:39:42 -06:00
jhwgh1968
19274b497a Made deflate compression into separate feature 2018-01-07 00:47:11 -06:00
rardiol
22194687c6 use flate2 1.0 2018-01-01 17:12:41 -03:00
Peter Williams
f85b5cb7b8 Add a test for ZIP64 with leading junk.
I constructed this file using a hack from the Zip manpage: if the input to a
Zip compression command is streamed on standard input, the output is given in
ZIP64 format since the tool doesn't know how big the input will be. I modified
the resulting file by adding some leading junk text and editing the non-ZIP64
end-of-central-directory structure to have 0xFFFF for its "number of files"
parameters, to help the test demonstrate that the ZIP64 data are being
properly read. (0xFFFF is the value used in the non-ZIP64 structure if the
archive actually has more than 65535 files.)
2017-08-12 14:42:32 -04:00
Peter Williams
4a297c32a8 Implement support for reading ZIP64 central-directory-end records
This provides only very basic ZIP64 support, but it allows us to properly read
archives with more than 65535 files, so long as none of the individual files
need ZIP64 support to be read.
2017-08-12 14:42:32 -04:00
Peter Williams
89f33c9348 Use u64's for internal file offsets.
These are better aligned with Rust's APIs, and lay the groundwork for more
convenient support of Zip64 files.
2017-08-12 14:42:32 -04:00
Mathijs van de Nes
2dae0d4a5c Add regression test for #40 2017-07-05 21:36:47 +02:00
Pascal Hertleif
57a6514a40 Prevent subtract with overflow
This changes assumes this only happens when the archive is invalid.

Fixes #40
2017-06-27 11:23:17 +02:00
Mathijs van de Nes
afb306d11d Merge branch 'feature/data-start' of https://github.com/bbqsrc/zip-rs 2017-04-28 12:43:03 +02:00
Brendan Molloy
60596d15d9 Add data_start property to ZipFile 2017-04-17 15:53:10 +10:00
Stephen M. Coakley
fc746a09db
Handle data prepended to the zip 2017-04-08 03:04:18 -05:00
Mathijs van de Nes
633360a5a7 Ignore Io errors in extra field
IoErrors mean that the extra field was not long enough or contained an invalid lenght value.
These are ignored for now.

Resolves #32
2017-03-30 19:18:08 +02:00
Mathijs van de Nes
1831edbbdd Expose the raw file name of a file
We still do most operations with normal Strings, but a user can now also get the raw bytes.

Resolves #26
2017-02-12 17:18:40 +01:00
Mathijs van de Nes
2a3fe099a6 Derive Debug for read::ZipArchive
Resolves #15
2016-08-08 17:34:02 +02:00
Mathijs van de Nes
1d2b43b2c0 Merge branch 'master' of git://github.com/efyang/zip-rs into efyang-master 2016-04-30 12:18:17 +02:00
Edward Yang
064b21b685 Add crc32 accessor for ZipFile 2016-04-29 17:04:08 -05:00
Mathijs van de Nes
e80213e250 Rename version to version_made_by
Also remove System for now
2016-04-27 14:30:00 +02:00
Alexander Koval
735bf4dfe4 Make system and version temporarilly private 2016-04-23 13:18:48 +03:00
Alexander Koval
1e935672bd Replace system attribute by enum 2016-04-23 13:12:28 +03:00
Alexander Koval
a16962cd2c Support for external file attributes 2016-04-23 10:31:54 +03:00
Mathijs van de Nes
aaa49eb4f1 Update to new bzip2 2016-02-22 19:46:07 +01:00
Mathijs van de Nes
7db32c9165 Remove unused parentheses 2016-02-02 21:17:42 +01:00
Alexander Bulaev
2addfa8b81 Made bzip2 compression method optional 2015-10-05 20:01:41 +03:00
Mathijs van de Nes
c97d6ed760 Use read_exact from ReadPodExt explicitly
The newely added read_exact from std::..::Read has an incompatible signature
and is not yet stabilized. This ensures that the crate will work on stable and
nightly.
2015-09-02 11:52:30 +02:00
Mathijs van de Nes
0e274281dd Use external crate to convert an MsDos datetime 2015-07-20 16:08:33 +02:00
Mathijs van de Nes
6cd6b752e3 Several updates to CP437 handling 2015-06-18 11:45:25 +02:00
Mathijs van de Nes
69599e1741 Add into_cow feature + removed some trivial casts 2015-03-26 21:56:05 +01:00
Mathijs van de Nes
c7df8157a9 Removed unsupported compression methods from enum
- Simplified enum to only show supported values
- Removed use of FromPrimitive
2015-03-16 10:34:48 +01:00
Mathijs van de Nes
aa4e395ec9 Use external crate for extra read/write methods 2015-03-09 11:55:19 +01:00
Mathijs van de Nes
522039a70d Use the correct start index for iteration 2015-03-01 12:01:39 +01:00
Mathijs van de Nes
d9b83af57c Large refactoring, mostly of the reader
- Combined reader and reader_spec into read
- Alter the iteration protocol for a zip archive
- Modify some names
2015-03-01 11:32:40 +01:00