Commit graph

341 commits

Author SHA1 Message Date
Mathijs van de Nes
e6a1c68a64 Update example to use new functionality 2019-04-06 17:19:18 +02:00
Mathijs van de Nes
2314abc307
Merge pull request #96 from damiencollard/file_and_dir_predicates
Add ZipFile::is_dir() and ZipFile::is_file().
2019-04-06 17:07:55 +02:00
Mathijs van de Nes
7b26b18b2f
Merge pull request #102 from jonpas/patch-1
Use add_directory in write_dir example
2019-04-06 16:54:32 +02:00
Mathijs van de Nes
cdbdc008fc Allow a Path to be used as a file/directory name
Instead of using string directly, also accept a Path object. This moves
the responsibility from using the correct path separator and not using
invalid path components to this library.
2019-04-06 16:30:02 +02:00
jonpas
c14a8c7f5d
Use add_directory in write_dir example
Fix compatibility with some unzip tools.
2019-03-30 21:06:43 +01:00
Mathijs van de Nes
d1a0a7d472 Require at libflate >= 0.1.21
libflate 0.1.21 fixes an issue in which certain deflate streams where
unreadable by Windows.

Resolves #99
2019-03-10 14:07:36 +01:00
Mathijs van de Nes
895cc95bb8
Merge pull request #100 from nareshganduri/master
Fix bounds check in DateTime::from_time
2019-03-06 09:39:07 +01:00
unknown
8a24ef994f Fix bounds check in DateTime::from_time 2019-03-05 21:43:59 -06:00
Damien Collard
d9c3c085a8 Fix CI test with --no-default-features failing.
This fix replaces the compressed test archive with a non-compressed
one.
2019-01-31 13:39:30 +01:00
Damien Collard
b9af51e654 Add ZipFile::is_dir() and ZipFile::is_file().
The naming matches that of std::fs::Metadata.

An entry is determined to be a directory based on the presence of
a trailing path separator, i.e. '/' or '\'.

This patch adds a small test zip containing files and directories.
Their names match their type so as to make testing easy.
2019-01-27 15:57:30 +01:00
Mathijs van de Nes
659c9186c6 Remove unused import 2018-12-06 19:55:29 +01:00
Mathijs van de Nes
df9bf606b2 No longer pursue 1.20.0 compatibiliy
Dependencies break this outside of our control, this goal is not
attainable in the long run.
2018-12-06 19:51:51 +01:00
Mathijs van de Nes
3d61d9cd8a Publish version 0.5.0
Changes include:
* Switched to a different deflate (de)compressor
* New DateTime api, removing default dependencies on time and msdos_time
2018-11-17 12:10:31 +01:00
Mathijs van de Nes
ad7a0fd4e5 Fix for rust 1.20.0 2018-11-17 12:10:23 +01:00
Mathijs van de Nes
b6e12e9451 Remove TODO
Changed my mind, API seems good
2018-11-17 11:53:53 +01:00
Mathijs van de Nes
803a4d7521 Do not allow writing to a directory 2018-11-17 11:53:37 +01:00
Mathijs van de Nes
cfbcd768d3 Fix bug in last_modified_time 2018-11-17 11:30:00 +01:00
Mathijs van de Nes
4fd5c9e509 Update DateTime API 2018-11-17 11:08:41 +01:00
Mathijs van de Nes
f94d4b7a78 Change date api
Remove msdos_time dependency, and introduce simplified DateTime object.
This object does bounds checking to see if dates are representable in
msdos.
2018-11-17 10:26:25 +01:00
Mathijs van de Nes
3f9bccbfc7 Merge branch 'srijs-unroll-crc' 2018-11-17 10:07:37 +01:00
Sam Rijs
8ae6d81ab9 use crc32fast crate for checksumming 2018-11-14 00:44:34 +11:00
Sam Rijs
2b42b0219b add read_entry benchmark 2018-11-13 23:55:59 +11:00
Mathijs van de Nes
4ae1db992c Merge branch 'add-libflate' of https://github.com/xmclark/zip-rs 2018-11-13 10:33:16 +01:00
Mackenzie Clark
847b38aece simplify appveyor 2018-11-12 16:28:17 -08:00
Mathijs van de Nes
7171b496d0 Merge branch 'srijs-file-info-perf-improvements' 2018-11-12 20:40:36 +01:00
Mackenzie Clark
5192fcef2f remove the rust 1.20.0 check 2018-11-10 08:37:28 -08:00
Mackenzie Clark
efd1ac69cb newline 2018-11-09 16:23:49 -08:00
Mackenzie Clark
6528ea63d2 use the fully qualified decoder name 2018-11-09 16:20:40 -08:00
Mackenzie Clark
9e849ef089 revert the code order changes 2018-11-09 16:20:23 -08:00
Sam Rijs
a9a3fb521e Defer conversion to time::Tm on read 2018-11-07 00:06:42 +11:00
Sam Rijs
9e8747872b Defer parsing of local file header 2018-11-06 23:14:23 +11:00
Sam Rijs
493424e93d Use BufReader in file_info example 2018-11-06 23:14:23 +11:00
Mackenzie Clark
c05b6c2317 add libflate feature 2018-11-04 10:12:21 -08:00
Mathijs van de Nes
27c79de0f8 Fix copy paste error in zip64_large 2018-10-17 14:46:22 +02:00
Mathijs van de Nes
475d655a75 Add test for large zip64 files
This test uses a dynamically generated zipfile to avoid having to store
very large objects in the git tree. The zipfile itself was produced
using the default linux zip utility.
2018-10-17 14:43:50 +02:00
Mathijs van de Nes
b716547a93 Fix travis for rust 1.20.0 2018-10-17 11:55:35 +02:00
Mathijs van de Nes
bb38674a14 Add archive_offset after processing extra fields
This ensures that the value will still be 0xFFFFFFFF before parsing a
zip64 extra field, and that the correction will also apply after the
parsing.
2018-10-17 11:45:41 +02:00
Mathijs van de Nes
9065122b93 Skip another test for 1.20.0
flate2/rust_backend now also needs a more recent version of rustc
2018-10-17 11:41:13 +02:00
Mathijs van de Nes
c286a8ba16 Zip64: also support a large header_start 2018-10-17 11:39:15 +02:00
Mathijs van de Nes
87dbf02e77 Add new example file_info
Like stdin_info, only displays the data of a file, but does not extract
the contents.
2018-10-17 11:38:44 +02:00
Mathijs van de Nes
a1d579b146 Silence warnings about AsciiExt
Some supported rust versions still require this import
2018-10-16 17:47:48 +02:00
Mathijs van de Nes
dbb871245b Fix parse_extra_field for zip64
The specification states that fields are only present when their
corresponding entry in the central directory is set to 0xFFFFFFFF.
2018-10-16 17:44:53 +02:00
Mathijs van de Nes
74639e46d7
Merge pull request #83 from camchenry/master
Add end-to-end test
2018-10-15 19:31:24 +02:00
camchenry
59075de36a Revert to Vec<u8> owned by cursor 2018-10-15 12:06:54 -04:00
camchenry
19250df9e9 Change end-to-end test to use &[u8] instead of Vec<u8> 2018-10-13 18:40:06 -04:00
camchenry
a8b5210487 Add end-to-end test 2018-10-13 18:16:12 -04:00
Mathijs van de Nes
52594745f3 Merge branch 'replace-try-macro-usage' of https://github.com/bfrascher/zip-rs into bfrascher-replace-try-macro-usage 2018-10-09 13:13:53 +02:00
Mathijs van de Nes
60a4426798 Fix travis script 2018-10-09 12:46:39 +02:00
Mathijs van de Nes
74446dd59b Do not test deflate-zlib on version 1.20.0 for now 2018-10-09 12:38:28 +02:00
Benedikt Rascher-Friesenhausen
804cfea51c Replace try! macros with ? operator calls
The `?` operator exists since Rust version 1.13.0 and has since become the
standard and recommended variant over the `try!` macro (see
https://doc.rust-lang.org/std/macro.try.html where it is explicitly mentioned to
use the `?` operator instead of the `try!` macro).

I think it is especially useful to replace the `try!` usages throughout the
examples (since new users might not be familiar with the `try!` macro at all).
2018-10-02 23:12:35 +02:00