extern crate cat_reader; use cat_reader::CatReader; use std::io::prelude::*; use std::{env, io}; fn main() { let mut args = env::args_os(); args.next(); let mut buf = [0; 4096]; let mut reader = CatReader::new(args); let mut stdout = io::stdout(); loop { let amt = reader.read(&mut buf).expect("read failed"); if amt == 0 { return; } stdout.write(&buf[..amt]).expect("write failed"); } }