mirror of
https://github.com/ouch-org/ouch.git
synced 2025-06-07 12:05:46 +00:00
zip: fix compression of files larger than 4GB
This commit is contained in:
parent
bef3e9e2fa
commit
50573f9d91
@ -219,10 +219,16 @@ where
|
|||||||
options
|
options
|
||||||
};
|
};
|
||||||
|
|
||||||
let mut file = fs::File::open(entry.path())?;
|
let mut file = fs::File::open(path)?;
|
||||||
|
let large = file.metadata().map_or(
|
||||||
|
true,
|
||||||
|
|metadata| metadata.len() > 0xffffffff, // 4 GB
|
||||||
|
);
|
||||||
writer.start_file(
|
writer.start_file(
|
||||||
path.to_str().unwrap(),
|
path.to_str().unwrap(),
|
||||||
options.last_modified_time(get_last_modified_time(&file)),
|
options
|
||||||
|
.large_file(large)
|
||||||
|
.last_modified_time(get_last_modified_time(&file)),
|
||||||
)?;
|
)?;
|
||||||
io::copy(&mut file, &mut writer)?;
|
io::copy(&mut file, &mut writer)?;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user