Skip to content

V0.15.2 tgz support with example

Choose a tag to compare

@digizeph digizeph released this 27 Nov 16:30
· 222 commits to main since this release
d64e792

What's Changed

use std::io::Read;

fn main() {
    let reader = oneio::get_reader("http://josephine.sobornost.net/josephine.sobornost.net/rpkidata/2023/08/04/rpki-20230804T000430Z.tgz").unwrap();
    let mut ar = tar::Archive::new(reader);
    for entry in ar.entries().unwrap() {
        let mut entry = entry.unwrap();
        let path = entry.path().unwrap().to_string_lossy().to_string();
        if path.ends_with("csv") {
            let mut content: String = String::default();
            entry.read_to_string(&mut content).unwrap();
            for line in content.lines() {
                println!("{}", line);
            }
        }
    }
}

Full Changelog: v0.15.1...v0.15.2