read

Function read 

Source
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?
examples/basic_read.rs (line 7)
3fn main() {
4
5    let filename = "test.prtgn".to_string();
6
7    let read_text = read(filename).unwrap().to_string();
8
9    println!("{}", read_text);
10}
More examples
Hide additional 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}