blob: b8a5e45b085a33302da8344cfd21f8e8663c70ea [file] [log] [blame]
Brian Silvermancc09f182022-03-09 15:40:20 -08001use std::fs::File;
2use std::io::prelude::*;
3
4use runfiles::Runfiles;
5
6fn main() {
7 let r = Runfiles::create().unwrap();
8
9 let mut f = File::open(r.rlocation("examples/hello_runfiles/hello_runfiles.rs")).unwrap();
10
11 let mut buffer = String::new();
12 f.read_to_string(&mut buffer).unwrap();
13
14 println!("This program's source is {} characters long.", buffer.len());
15}