Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Tar file reading/writing for Rust

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
NotificationsYou must be signed in to change notification settings

alexcrichton/tar-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Documentation

A tar archive reading/writing library for Rust.

# Cargo.toml[dependencies]tar ="0.4"

Reading an archive

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);}}

Writing an archive

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();}

License

This project is licensed under either of

at your option.

Contribution

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-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp