Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@Earlz
Created December 14, 2014 22:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Earlz/2e013bc180c78661123e to your computer and use it in GitHub Desktop.
Save Earlz/2e013bc180c78661123e to your computer and use it in GitHub Desktop.
use std::io;
use std::io::File;
use std::os;
use std::str;
fn main() {
println!("meh");
let filename=&os::args()[1];
let contents: String = match File::open(&Path::new(filename)).read_to_end() {
Ok(s) => str::from_utf8(s.as_slice()).expect("this shouldn't happen").to_string(),
Err(e) => "".to_string()
};
println!("ugh {}", contents.to_string());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment