Auto merge of #962 - christianpoveda:file-shim, r=oli-obk

Add shims for file handling

This adds the bare minimum to be able to do `File::open` and `File::read`. I also need some feedback about how to handle certain things
This commit is contained in:
bors
2019-10-01 15:33:09 +00:00
7 changed files with 260 additions and 0 deletions
+1
View File
@@ -0,0 +1 @@
Hello, World!
+13
View File
@@ -0,0 +1,13 @@
// ignore-windows: File handling is not implemented yet
// compile-flags: -Zmiri-disable-isolation
use std::fs::File;
use std::io::Read;
fn main() {
// FIXME: create the file and delete it when `rm` is implemented.
let mut file = File::open("./tests/hello.txt").unwrap();
let mut contents = String::new();
file.read_to_string(&mut contents).unwrap();
assert_eq!("Hello, World!\n", contents);
}