extern crate tar;
      extern crate flate2;
      use std::fs::File;
      use flate2::Compression;
      use flate2::write::GzEncoder;
      
      fn main() -> Result<(), std::io::Error> {
        let path = "compressed.tar.gz";
        let tar_gz = File::open(path)?;
        let tar = GzDecoder::new(tar_gz);
        let mut archive = Archive::new(tar);
        archive.unpack(".")?;
        Ok(())
      }
      
      Rust language logo

      Decompress file

      Codiga's Rust Recipes

      Decompres tarball in current folder

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.