- Notifications
You must be signed in to change notification settings - Fork214
Tar file reading/writing for Rust
License
Apache-2.0, MIT licenses found
Licenses found
Apache-2.0
LICENSE-APACHEMIT
LICENSE-MITNotificationsYou must be signed in to change notification settings
alexcrichton/tar-rs
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
A tar archive reading/writing library for Rust.
# Cargo.toml[dependencies]tar ="0.4"
externcrate tar;use std::io::prelude::*;use std::fs::File;use tar::Archive;fnmain(){let file =File::open("foo.tar").unwrap();letmut a =Archive::new(file);for filein a.entries().unwrap(){// Make sure there wasn't an I/O errorletmut file = file.unwrap();// Inspect metadata about the fileprintln!("{:?}", file.header().path().unwrap());println!("{}", file.header().size().unwrap());// files implement the Read traitletmut s =String::new(); file.read_to_string(&mut s).unwrap();println!("{}", s);}}
externcrate tar;use std::io::prelude::*;use std::fs::File;use tar::Builder;fnmain(){let file =File::create("foo.tar").unwrap();letmut a =Builder::new(file); a.append_path("file1.txt").unwrap(); a.append_file("file2.txt",&mutFile::open("file3.txt").unwrap()).unwrap();}
This project is licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE orhttp://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT orhttp://opensource.org/licenses/MIT)
at your option.
Unless you explicitly state otherwise, any contribution intentionally submittedfor inclusion in this project by you, as defined in the Apache-2.0 license,shall be dual licensed as above, without any additional terms or conditions.
About
Tar file reading/writing for Rust
Resources
License
Apache-2.0, MIT licenses found
Licenses found
Apache-2.0
LICENSE-APACHEMIT
LICENSE-MITUh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
No packages published
Uh oh!
There was an error while loading.Please reload this page.