diff --git a/src/disk.rs b/src/disk.rs index b018b5e..a039678 100644 --- a/src/disk.rs +++ b/src/disk.rs @@ -43,7 +43,7 @@ impl DiskController { .set_title(&format!("Select a file to insert")) .pick_file(); match path { - Some(path) => Some(File::open(path).expect("failed to open disk image")), + Some(path) => Some(File::options().read(true).write(true).open(path).expect("failed to open disk image")), None => None, } } diff --git a/src/main.rs b/src/main.rs index e2f00e6..0946a8a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -106,7 +106,7 @@ fn main() { let mut args_iter = args.iter(); args_iter.next(); for (i, arg) in args_iter.enumerate() { - bus.disk_controller.insert(File::open(&arg).expect("failed to load provided disk image"), i as u8); + bus.disk_controller.insert(File::options().read(true).write(true).open(&arg).expect("failed to load provided disk image"), i as u8); } }