joymoe / archiver-rs Goto Github PK
View Code? Open in Web Editor NEWA library for easy interaction with multiple archive formats
License: MIT License
A library for easy interaction with multiple archive formats
License: MIT License
Please add support for zstd compression algorithm. You can potentially use zstd bindings already available for Rust.
Most underlying crate you're using in this project are already compatible with async Rust. Please consider adding extensions to this crate that would made it more suitable to use in async contexts.
I'm trying to extract a tar.xz file and I get an InvalidData io error.
The relevant pattern for .tar.xz seems to be missing in lib.rs:
match buffer {
#[cfg(all(feature = "bzip", feature = "tar"))]
[0x42, 0x5A] => Ok(Box::new(Tar::new(Bzip2::new(file)?)?)), // .tar.gz
#[cfg(all(feature = "gzip", feature = "tar"))]
[0x1F, 0x8B] => Ok(Box::new(Tar::new(Gzip::new(file)?)?)), // .tar.gz
#[cfg(feature = "zip")]
[0x50, 0x4B] => Ok(Box::new(Zip::new(file)?)), // .zip
_ => Err(Error::from(ErrorKind::InvalidData))?,
}
When I run the following code I:
let path = Path::new("my.tar.xz");
let mut file = File::open(&path)?;
let mut buffer = [0u8; 2];
file.read(&mut buffer)?;
file.seek(SeekFrom::Start(0))?;
for b in buffer.iter() {
println!("{:x}", b);
}
I get 0xfd and 0x37 as the first two bytes so would suggest the following addition:
#[cfg(all(feature = "xz", feature = "tar"))]
[0xFD, 0x37] => Ok(Box::new(Tar::new(Xz::new(file)?)?)), // .tar.xz
Thank you for this great crate!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.