chore: checkpoint before Python removal

This commit is contained in:
2026-03-26 22:33:59 +00:00
parent 683cec9307
commit e568ddf82a
29972 changed files with 11269302 additions and 2 deletions

25
vendor/tar/examples/extract_file.rs vendored Normal file
View File

@@ -0,0 +1,25 @@
//! An example of extracting a file in an archive.
//!
//! Takes a tarball on standard input, looks for an entry with a listed file
//! name as the first argument provided, and then prints the contents of that
//! file to stdout.
extern crate tar;
use std::env::args_os;
use std::io::{copy, stdin, stdout};
use std::path::Path;
use tar::Archive;
fn main() {
let first_arg = args_os().nth(1).unwrap();
let filename = Path::new(&first_arg);
let mut ar = Archive::new(stdin());
for file in ar.entries().unwrap() {
let mut f = file.unwrap();
if f.path().unwrap() == filename {
copy(&mut f, &mut stdout()).unwrap();
}
}
}