Skip to content

Instantly share code, notes, and snippets.

@quux00
Created January 27, 2014 03:31
Show Gist options
  • Save quux00/8642880 to your computer and use it in GitHub Desktop.
Save quux00/8642880 to your computer and use it in GitHub Desktop.
use std::io::File;
use std::str;
fn main() {
let file_name_abs = ~"foo";
let mut response =~ "";
match File::open(&Path::new(file_name_abs)) {
Some(html_file) => {
let mut html_file_mut = html_file;
let msg_bytes: ~[u8] = html_file_mut.read_to_end();
response.push_str(str::from_utf8(msg_bytes));
println(response);
},
None => {
println("not found!");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment