mirror of
https://github.com/ouch-org/ouch.git
synced 2025-07-22 01:20:24 +00:00
Merge pull request #354 from figsoda/large
zip: fix compression of files larger than 4GB
This commit is contained in:
commit
d36c206c13
@ -24,7 +24,9 @@ Categories Used:
|
||||
|
||||
- Multi-threaded compression for gzip and snappy using gzp [\#348](https://github.com/ouch-org/ouch/pull/348) ([figsoda](https://github.com/figsoda))
|
||||
|
||||
### Bug fixes
|
||||
### Bug Fixes
|
||||
|
||||
- Fix decompression of zip archives with files larger than 4GB [\#354](https://github.com/ouch-org/ouch/pull/354) ([figsoda](https://github.com/figsoda))
|
||||
|
||||
- Fix handling of unknown extensions during decompression [\#355](https://github.com/ouch-org/ouch/pull/355) ([figsoda](https://github.com/figsoda))
|
||||
|
||||
|
@ -145,7 +145,9 @@ where
|
||||
W: Write + Seek,
|
||||
{
|
||||
let mut writer = zip::ZipWriter::new(writer);
|
||||
let options = zip::write::FileOptions::default();
|
||||
// always use ZIP64 to allow compression of files larger than 4GB
|
||||
// the format is widely supported and the extra 20B is negligible in most cases
|
||||
let options = zip::write::FileOptions::default().large_file(true);
|
||||
let output_handle = Handle::from_path(output_path);
|
||||
|
||||
#[cfg(not(unix))]
|
||||
@ -219,7 +221,7 @@ where
|
||||
options
|
||||
};
|
||||
|
||||
let mut file = fs::File::open(entry.path())?;
|
||||
let mut file = fs::File::open(path)?;
|
||||
writer.start_file(
|
||||
path.to_str().unwrap(),
|
||||
options.last_modified_time(get_last_modified_time(&file)),
|
||||
|
Loading…
x
Reference in New Issue
Block a user