pub fn uncompress_archive_file_with_encoding<R, W>(
source: R,
target: W,
path: &str,
decode: DecodeCallback
) -> Result<usize>where
R: Read + Seek,
W: Write,
Expand description
Uncompress a specific file from an archive. The source
is used as a
reader, the target
as a writer and the path
is the relative path for
the file to be extracted from the archive.
Example
use compress_tools::*;
use std::fs::File;
let mut source = File::open("tree.tar.gz")?;
let mut target = Vec::default();
let decode_utf8 = |bytes: &[u8]| Ok(std::str::from_utf8(bytes)?.to_owned());
uncompress_archive_file_with_encoding(&mut source, &mut target, "file/path", decode_utf8)?;