tarfs/tar-0.4.41/examples/write.rs

14 lines
285 B
Rust
Raw Permalink Normal View History

2024-06-09 18:32:21 -05:00
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();
}