sevenz-rust
sevenz-rust copied to clipboard
ChecksumVerificationFailed on read of many files in solid archive
I have solid archives with block size of 16Mb. And many of the files fail to read because of ChecksumVerificationFailed
.
Example archive: https://up.revertron.com/Memes.7z
Example code:
pub fn test_blocks() {
let mut buf = Vec::new();
let mut archive = SevenZReader::open("Memes.7z", Password::empty()).expect("Error opening 7z archive");
let _ = archive.for_each_entries(|entry, reader| {
println!("Reading file {}", &entry.name);
if "FcGD7nuX0AgQNS_.jpg" == entry.name {
println!("*** Found file {}", &entry.name);
match reader.read_to_end(&mut buf) {
Ok(_size) => {
println!("Have read file {}", &entry.name);
return Ok(false);
}
Err(e) => {
println!("Error reading file {}: {}", &entry.name, &e);
return Err(sevenz_rust::Error::from(e));
}
}
}
Ok(true)
});
assert!(!buf.is_empty())
}