| std::process::exit(real_main()); |
| let args: Vec<_> = std::env::args().collect(); |
| println!("Usage: {} <filename>", args[0]); |
| let fname = std::path::Path::new(&*args[1]); |
| let file = fs::File::open(&fname).unwrap(); |
| let reader = BufReader::new(file); |
| let mut archive = zip::ZipArchive::new(reader).unwrap(); |
| for i in 0..archive.len() { |
| let file = archive.by_index(i).unwrap(); |
| let outpath = match file.enclosed_name() { |
| println!("Entry {} has a suspicious path", file.name()); |
| let comment = file.comment(); |
| println!("Entry {} comment: {}", i, comment); |
| if (*file.name()).ends_with('/') { |
| "Entry {} is a directory with name \"{}\"", |
| "Entry {} is a file with name \"{}\" ({} bytes)", |