RupertAvery / PSXPackager

A utility to convert Playstation disc images in various formats to PBP format and back
Other
230 stars 15 forks source link

Access denied when input files are read-only #52

Closed joshbarrass closed 11 months ago

joshbarrass commented 1 year ago

Running v1.6.2 on Linux, I discovered that PSXPackager fails with an "access denied" error if it lacks write permission on the input files. I could understand the problem if it lacked write permissions on the output directory, but it should be able to function without write permissions on the inputs.

Steps: 1) chmod -w game.cue game.bin 2) ./psxpackager -i game.cue -o . -f "%MAINTITLE% [%MAINGAMEID%] (%REGION%)"

Expected Output: PSXPackager runs without error.

Actual Results:

$ ./psxpackager -i game.cue -o . -f "%MAINTITLE% [%MAINGAMEID%] (%REGION%)"
PSXPackager v1.6.2 by RupertAvery

Input : game.cue
Output: .
Compression Level: 5

Processing started: 15:03:21
Processing game.cue

Access to the path 'game.bin' is denied.
Processing completed: 00h 00m 00s

This access denied error is fixed by executing chmod +w game.cue game.bin.

RupertAvery commented 1 year ago

Thanks for this.

I've found the bug, it's related to opening a file without specifying the mode.