1 use std::fs::File; 2 use std::io::prelude::*; 3 4 use runfiles::Runfiles; 5 main()6fn main() { 7 let r = Runfiles::create().unwrap(); 8 9 let mut f = File::open(runfiles::rlocation!( 10 r, 11 "examples/hello_runfiles/hello_runfiles.rs" 12 )) 13 .unwrap(); 14 15 let mut buffer = String::new(); 16 f.read_to_string(&mut buffer).unwrap(); 17 18 println!("This program's source is {} characters long.", buffer.len()); 19 } 20