Commit graph

6 commits

Author SHA1 Message Date
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
602952750e Update DEFAULT_VERSION
Use a more sane 'version made by' as we can write Bzip2 files
2018-05-22 23:36:56 +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
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
Mathijs van de Nes
2dae0d4a5c Add regression test for #40 2017-07-05 21:36:47 +02:00
Jos van den Oever
93f676fa57 Add two simple tests. 2017-03-14 20:16:51 +01:00