Note: this question is about pre Rust 1.0 and thus outdated. See the linked duplicate for an up to date answer.
I'm writing a test program using Rust 0.8 on Win8, and I need to read and write some parameters used by the program to/from a text file using an array/vector/list to access individual lines.
After spending considerable time attempting to find something that works, the closest that I could find is as follows :
use std::rt::io::{file, Open};
use std::path::Path;
use std::rt::io::file::FileInfo;
fn main () {
let mut reader : file::FileReader = Path("xxxx.txt").open_reader(Open)
.expect("'xxxx.txt' could not be opened");
println("Completed");
}
The above "works" if the file exists.
Could someone please show me an example of how to do what I have stated as the requirement?