]> git.proxmox.com Git - rustc.git/blob - vendor/tar-0.4.38/examples/list.rs
New upstream version 1.74.1+dfsg1
[rustc.git] / vendor / tar-0.4.38 / examples / list.rs
1 //! An example of listing the file names of entries in an archive.
2 //!
3 //! Takes a tarball on stdin and prints out all of the entries inside.
4
5 extern crate tar;
6
7 use std::io::stdin;
8
9 use tar::Archive;
10
11 fn main() {
12 let mut ar = Archive::new(stdin());
13 for file in ar.entries().unwrap() {
14 let f = file.unwrap();
15 println!("{}", f.path().unwrap().display());
16 }
17 }