BlueSCSI / BlueSCSI-v2

Open source, open hardware, SCSI emulator using the Pi Pico PR2040
https://bluescsi.com
GNU General Public License v3.0
227 stars 23 forks source link

after HD[X]9_imaged.hda is written the next file isn't writable #175

Open dericed opened 3 weeks ago

dericed commented 3 weeks ago

On my SD card, I have these files:

HD60_imaged.hda
HD61_imaged.hda
HD62_imaged.hda
HD63_imaged.hda
HD64_imaged.hda
HD65_imaged.hda
HD66_imaged.hda
HD67_imaged.hda
HD68_imaged.hda
HD69_imaged.hda
bluescsi.ini
log.txt

When I begin a subsequent transfer, I get these lines in the log:

[22595ms] Using filename: HD6:_imaged.hda to avoid overwriting existing file.
[22595ms] Failed to open file for writing: HD6:_imaged.hda

Perhaps the increment sets a : (colon) as the value after 9.

I can work around this by removing the existing files.

erichelgeson commented 3 weeks ago

Thanks for reporting! Yes it's due to me just simply incrementing the lun, which when it gets to 9 in ascii the next value is :. A simple printf or something would be better instead of modifying that one byte. https://github.com/BlueSCSI/BlueSCSI-v2/blob/main/src/BlueSCSI_initiator.cpp#L271

A good first issue for someone who might want to contribute.