From 6321b5f1b4203d1d3748fe2073e8d7b18612a37c Mon Sep 17 00:00:00 2001 From: Lucas Schwiderski Date: Tue, 26 Apr 2022 22:21:25 +0200 Subject: [PATCH] fix: Fix opening file in read-only mode --- src/main.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 10580a1..87e7c88 100644 --- a/src/main.rs +++ b/src/main.rs @@ -18,7 +18,11 @@ fn fix_file

(path: P) -> Result<()> where P: AsRef, { - let mut f = File::open(&path).with_context(|| "failed to open sound bank file")?; + let mut f = File::options() + .write(true) + .read(true) + .open(&path) + .with_context(|| "failed to open sound bank file")?; f.seek(SeekFrom::Start(OFFSET_VERSION_NUMBER)) .with_context(|| "failed to seek to version number offset")?;