1
Fork 0

fix: Fix opening file in read-only mode

This commit is contained in:
Lucas Schwiderski 2022-04-26 22:21:25 +02:00
parent e2a8d4f951
commit 6321b5f1b4
Signed by: lucas
GPG key ID: AA12679AAA6DF4D8

View file

@ -18,7 +18,11 @@ fn fix_file<P>(path: P) -> Result<()>
where
P: AsRef<Path>,
{
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")?;