{"id":13438732,"url":"https://github.com/alexcrichton/tar-rs","last_synced_at":"2025-05-13T17:07:59.380Z","repository":{"id":18734582,"uuid":"21946092","full_name":"alexcrichton/tar-rs","owner":"alexcrichton","description":"Tar file reading/writing for Rust","archived":false,"fork":false,"pushed_at":"2025-02-25T21:25:26.000Z","size":1866,"stargazers_count":659,"open_issues_count":111,"forks_count":203,"subscribers_count":14,"default_branch":"main","last_synced_at":"2025-04-23T23:12:17.629Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://docs.rs/tar","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alexcrichton.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-07-17T14:56:29.000Z","updated_at":"2025-04-22T13:08:10.000Z","dependencies_parsed_at":"2024-09-29T00:01:03.548Z","dependency_job_id":"f1dbeb46-f23d-4041-8c74-5bd1dbac6ad5","html_url":"https://github.com/alexcrichton/tar-rs","commit_stats":{"total_commits":451,"total_committers":77,"mean_commits":5.857142857142857,"dds":0.3902439024390244,"last_synced_commit":"2064e86eb331966e916ceb31244758187b58b038"},"previous_names":[],"tags_count":71,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexcrichton%2Ftar-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexcrichton%2Ftar-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexcrichton%2Ftar-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexcrichton%2Ftar-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alexcrichton","download_url":"https://codeload.github.com/alexcrichton/tar-rs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250528873,"owners_count":21445518,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T03:01:07.974Z","updated_at":"2025-04-23T23:12:24.332Z","avatar_url":"https://github.com/alexcrichton.png","language":"Rust","funding_links":[],"categories":["Libraries","代码","Rust","库 Libraries","库"],"sub_categories":["Compression","压缩","压缩 Compression"],"readme":"# tar-rs\n\n[Documentation](https://docs.rs/tar)\n\nA tar archive reading/writing library for Rust.\n\n```toml\n# Cargo.toml\n[dependencies]\ntar = \"0.4\"\n```\n\n## Reading an archive\n\n```rust,no_run\nextern crate tar;\n\nuse std::io::prelude::*;\nuse std::fs::File;\nuse tar::Archive;\n\nfn main() {\n    let file = File::open(\"foo.tar\").unwrap();\n    let mut a = Archive::new(file);\n\n    for file in a.entries().unwrap() {\n        // Make sure there wasn't an I/O error\n        let mut file = file.unwrap();\n\n        // Inspect metadata about the file\n        println!(\"{:?}\", file.header().path().unwrap());\n        println!(\"{}\", file.header().size().unwrap());\n\n        // files implement the Read trait\n        let mut s = String::new();\n        file.read_to_string(\u0026mut s).unwrap();\n        println!(\"{}\", s);\n    }\n}\n\n```\n\n## Writing an archive\n\n```rust,no_run\nextern crate tar;\n\nuse std::io::prelude::*;\nuse std::fs::File;\nuse tar::Builder;\n\nfn main() {\n    let file = File::create(\"foo.tar\").unwrap();\n    let mut a = Builder::new(file);\n\n    a.append_path(\"file1.txt\").unwrap();\n    a.append_file(\"file2.txt\", \u0026mut File::open(\"file3.txt\").unwrap()).unwrap();\n}\n```\n\n# License\n\nThis project is licensed under either of\n\n * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or\n   http://www.apache.org/licenses/LICENSE-2.0)\n * MIT license ([LICENSE-MIT](LICENSE-MIT) or\n   http://opensource.org/licenses/MIT)\n\nat your option.\n\n### Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in this project by you, as defined in the Apache-2.0 license,\nshall be dual licensed as above, without any additional terms or conditions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexcrichton%2Ftar-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexcrichton%2Ftar-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexcrichton%2Ftar-rs/lists"}