1 //! This little test binary reads stdin, and then writes what it read to both 2 //! stdout and stderr, with a little tag to differentiate them. We use it to 3 //! test duping the standard file descriptors. 4 5 #![deny(warnings)] 6 7 use std::io; 8 use std::io::prelude::*; 9 main()10fn main() { 11 let mut input = Vec::new(); 12 io::stdin().read_to_end(&mut input).unwrap(); 13 14 print!("stdout: "); 15 io::stdout().write_all(&input).unwrap(); 16 17 eprint!("stderr: "); 18 io::stderr().write_all(&input).unwrap(); 19 } 20