tarfs/tar-0.4.41/examples/write.rs
2024-06-13 17:04:34 -05:00

14 lines
285 B
Rust

extern crate tar;
use std::fs::File;
use tar::Builder;
fn main() {
let file = File::create("foo.tar").unwrap();
let mut a = Builder::new(file);
a.append_path("README.md").unwrap();
a.append_file("lib.rs", &mut File::open("src/lib.rs").unwrap())
.unwrap();
}