pub fn read(filename: String) -> Result<String>Expand description
Reads a PRTGN encoded file.
ยงExamples
let filename = "test.prtgn".to_string();
let read_text = read(filename).unwrap().to_string();
println!("{}", read_text);If the file is using an older encoding standard it is automatically updated to the newest version.
Examples found in repository?
More examples
examples/read_write.rs (line 11)
3fn main() {
4 let filename = "test.prtgn".to_string();
5 let text = "Hello world! This is some example text.".to_string();
6
7 write(filename, text).unwrap();
8
9 let filename = "test.prtgn".to_string();
10
11 let read_text = read(filename).unwrap().to_string();
12
13 println!("{}", read_text)
14}