Commit graph

50 commits

Author SHA1 Message Date
jonpas
b171b915f8 Switch to flate2 2019-06-14 15:25:00 +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
Mathijs van de Nes
659c9186c6 Remove unused import 2018-12-06 19:55:29 +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
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
Sam Rijs
8ae6d81ab9 use crc32fast crate for checksumming 2018-11-14 00:44:34 +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
Sam Rijs
a9a3fb521e Defer conversion to time::Tm on read 2018-11-07 00:06:42 +11:00
Mackenzie Clark
c05b6c2317 add libflate feature 2018-11-04 10:12:21 -08: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
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
Mathijs van de Nes
b23200d4a1 Append a slash to directory names
If a directory name does not end with a slash, append it to it when
writing a zip file. This way we can ensure it is distuinguishable from
an empty file.
2018-08-15 21:54:24 +02:00
Mathijs van de Nes
39ccaab76c Merge branch 'flate2-backends' of https://github.com/alexbool/zip-rs 2018-05-27 10:33:52 +02:00
Mathijs van de Nes
ab9667aa5c Properly write 'version needed' in local file header
'version made by' was used instead of version needed by accident.

Resolves #72
2018-05-22 23:36:56 +02:00
Alexander Bulaev
fee626ba59 Control backend choice of flate2 2018-05-19 20:03:23 +03:00
Mathijs van de Nes
b2db9d55ae Merge branch 'deflate_feature' of https://github.com/jhwgh1968/zip-rs 2018-01-09 18:38:27 +01:00
Danilo Bargen
2469419a89 Fix compatibility with Rust <1.23 2018-01-08 08:26:49 +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
Mathijs van de Nes
bbb279286a Remove unused import 2018-01-06 12:06:23 +01:00
rardiol
22194687c6 use flate2 1.0 2018-01-01 17:12:41 -03:00
Mathijs van de Nes
7aaedf6457 Add Copy/Clone for FileOptions
Resolves #38
2017-05-28 12:26:18 +02:00
Mathijs van de Nes
240e1d469d Corrected some static -> const 2017-04-28 10:31:12 +02:00
Mathijs van de Nes
236050947a Fix a regression
Test would not compile anymore... weird
2017-03-30 19:03:25 +02:00
Jos van den Oever
93f676fa57 Add two simple tests. 2017-03-14 20:16:51 +01:00
Mihai STAN
7d85d8fb66 Fix writing to buffers.
Using SeekFrom::End(0) in finish_file for a buffer was movind the position
the the end of the buffer, not the last written byte.
2017-03-06 06:22:42 +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
d2d19f6539 Update the write API
This change adds a FileOptions struct. This struct can be filled using a builder pattern
to set the options for a file or folder.

With this change, we also introduce the option to set the (unix) permissions of a file or folder.
2016-10-30 09:09:50 +01:00
Mathijs van de Nes
82315c9511 Add comments to write.rs
Clarify which field means what when writing structures
2016-10-29 12:30:59 +02: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
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
d95c925ac2 Let ZipWriter::finish be called without consuming
Resolves #10
2016-02-22 19:54:18 +01:00
Mathijs van de Nes
aaa49eb4f1 Update to new bzip2 2016-02-22 19:46:07 +01:00
Mathijs van de Nes
64a67162ab Fix incorrect CRC on large files
The deflate writer did not always accept all data. The extra bytes did end up in the crc
calculation, so they where accounted for twice.

Resolves #8
2015-12-06 11:01:51 +01:00
Alexander Bulaev
2addfa8b81 Made bzip2 compression method optional 2015-10-05 20:01:41 +03: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
e4576353f7 Accept both String and &str in start_file 2015-05-25 09:46:08 +02:00
Mathijs van de Nes
c05e8a5f04 Do not use unsafe_destructor 2015-04-03 14:55:49 +02:00
Mathijs van de Nes
80fd4b6dcf Update to new (io::)Error 2015-04-02 20:50:50 +02:00
Mathijs van de Nes
aa8acab465 Do not switch compression if not needed 2015-03-17 17:22:30 +01:00
Mathijs van de Nes
0339ed2742 Move the pattern matching of genericzipwriter 2015-03-17 17:06:32 +01:00
Mathijs van de Nes
11fa463cb4 Do not close the zip on flush
Instead, only flush the underlying buffer
2015-03-17 16:55:22 +01:00
Mathijs van de Nes
c4cf221f70 Save the unsupported value of CompressionMethod 2015-03-16 10:47:16 +01:00
Mathijs van de Nes
132530cb41 Remove some as_slice calls 2015-03-16 10:15:46 +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
8ee78c5314 Removed last remnants of old_io 2015-03-03 19:28:58 +01:00
Mathijs van de Nes
b16da11570 Small updates to write module 2015-03-01 11:53:26 +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
Renamed from src/writer.rs (Browse further)