Menu

#22 cbmcopy output file suffix

v0.5.0
closed
None
1
2017-09-22
2014-07-28
Simon Rowe
No

I can't make sense of the output file naming for cbmcopy -r. Given a sequential file called "128basic" on a disk running

cbmcopy -r 8 128basic,s

results in an output file called

128basic,s.prg

Looking are the code cbmcopy/main.c:569 seems to be trying to set an appropriate suffix based on the character following the comma but the switch statement uses uppercase.

Repeating with a capital S

cbmcopy -r 8 128basic,S

fails because of the ASCII to PETSCII translation

[Info] reading 128BASIC,� -> 128basic,S.seq
[Info] identified a 1540 or 1541 drive
[Fatal] could not open file for reading: 64, FILE TYPE MISMATCH,00,00
[Warning] error reading 128BASIC,�

Attached is a patch which

  1. switches on lowercase
  2. strips the trailing file type

    cbmcopy -r 8 128basic,s
    [Info] reading 128BASIC,S -> 128basic.seq
    [Info] identified a 1540 or 1541 drive
    .-[Info] 00, OK,00,00

1 Attachments

Discussion

  • Spiro Trikaliotis

    Hello Simon,

    thanks for your patch. In fact, I was not even aware the cbmcopy tries to do such conversions.

    From having a look, your patch seems sensible to me. However, I want to do some tests before I add it to the repository. I will come back to you when I did the tests.

    • Spiro
     
  • Spiro Trikaliotis

    • status: open --> accepted
    • assigned_to: Spiro Trikaliotis
     
  • Spiro Trikaliotis

    • status: accepted --> closed
     
  • Spiro Trikaliotis

    Commit id: 2210d2 for your patch, 18d860 for changing to strrchr().

     
  • Spiro Trikaliotis

    Huh? I already wrote some text, but that seems to have been lost. Thus, again:

    Thank you for your patch. I appied it.

     
  • Anonymous

    Anonymous - 2017-09-21

    I have this same problem, how do I apply this patch? Using Win 7 and gui4cbm4win.exe and ZoomFloppy.

     
  • Spiro Trikaliotis

    Just use the latest released version of OpenCBM. Currently it's 0.4.99.99

     
  • Anonymous

    Anonymous - 2017-09-22

    Still getting [Fatal] could not open file for reading: 64, FILE TYPE MISMATCH,00,00 with current version. Tried 2 different laptops so far. Around half the files do this. Tried with 1541 and 1571.

     

Anonymous
Anonymous

Add attachments
Cancel