File: list.rs

package info (click to toggle)
rust-tar 0.4.44-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 552 kB
  • sloc: makefile: 2
file content (17 lines) | stat: -rw-r--r-- 386 bytes parent folder | download | duplicates (39)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//! An example of listing the file names of entries in an archive.
//!
//! Takes a tarball on stdin and prints out all of the entries inside.

extern crate tar;

use std::io::stdin;

use tar::Archive;

fn main() {
    let mut ar = Archive::new(stdin());
    for file in ar.entries().unwrap() {
        let f = file.unwrap();
        println!("{}", f.path().unwrap().display());
    }
}