Created
January 27, 2014 03:31
-
-
Save quux00/8642880 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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