From bf48300f2f93ae176beb3a21e4865d43268db35f Mon Sep 17 00:00:00 2001 From: Ry Date: Sat, 17 Sep 2022 00:10:44 -0700 Subject: [PATCH] Open disks as read-write --- src/disk.rs | 2 +- src/main.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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); } }