wide-energy-11069
11/13/2018, 11:48 PMpub fn compress() -> Result<(), std::io::Error> {
let tar_gz = File::create("archive.tar.gz")?;
let enc = GzEncoder::new(tar_gz, Compression::default());
let mut tar = tar::Builder::new(enc);
let mut f = File::open("/tmp/good/gen/scrooge/297e53822ddf/wilyns.thrift.src.main.thrift.thrift-scala/c8959dfdc97a/com/twitter/wilyns/thriftscala/LookupRequest.scala").unwrap();
tar.append_file("gen/scrooge/297e53822ddf/wilyns.thrift.src.main.thrift.thrift-scala/c8959dfdc97a/com/twitter/wilyns/thriftscala/LookupRequest.scala",
&mut f)?;
Ok(())
}
generates archive.tar.gz"
. Then tar -xvf archive.tar.gz
produces the correct LookupRequest.scala
, whereas using rust to untar it giving LookupRequest.scala
as a directory.