Menu

#1933 confusing error message if rom file points to a directory, not a file.

v3.x
closed-fixed
compyx
None
GTK3
I/O System
2023-12-17
2023-08-18
No

Setting kernal rom file to point to a directory instead of a file produces a confusing error message.

 Loading system file `/home/myhome/directory/'.
 Warning - ROM `/home/myhome/directory/': long file (9223372036854775807), discarding end (9223372036854767615 bytes).

It seems like it doesn't notice that this is a directory, not a file.

x64dtv r44425 on Ubuntu 20.04LTS

Discussion

  • compyx

    compyx - 2023-08-19

    I've added a check in sysfile_open() to determine if we're trying to open a directory instead of a file. The function will now not attempt to read a directory and issue a slightly more informative error message:

    Error - '/home/compyx/src/vice/trunk/gtk3-build/' is a directory, not a file.
    

    We still get the error about missing filename though: Error - Missing name for system file., since the resource setters for the ROMs happily accept an empty string.

    It would probably make sense to use the resource's default value if passed an empty string, resulting in loading the default file in that case.
    That would require going through all the ROM file resource setters and updating the ones that control a required file (such as "KernalName"), and updating the UI to display that default value when the user clears such an entry.

    The SDL UI also accepts setting an empty string of sorts: selecting "enter filename" and hitting Enter results in the working directory being used for the resource, which leads to the "is a directory" error message on the terminal and the UI showing the directory as the new resource value.

     
  • compyx

    compyx - 2023-08-19
    • assigned_to: compyx
     
  • Daniel Kahlin

    Daniel Kahlin - 2023-08-19

    Very good, much less confusing!

     
  • compyx

    compyx - 2023-08-28
    • status: open --> open-need-info
     
  • compyx

    compyx - 2023-08-28

    The confusing error message has been fixed, and VICE will not attempt to read a directory as a file. So the direct issue in this ticket is fixed, but the underlying issues of what to do with empty ROM file resources still needs consensus.

    My personal preference would be to revert to the default ROM filename if that ROM resource is a required ROM file (e.g. "KernalName" in x64sc when not using Max Machine, or x64dtv where the kernal is part of the flash).

     
  • compyx

    compyx - 2023-10-29

    So what do we do about setting ROM resources to ""? Ignore, segfault, format HDD?

     
  • compyx

    compyx - 2023-12-17
    • status: open-need-info --> closed-fixed
     
  • compyx

    compyx - 2023-12-17

    Closing to due to zero interest.

     

Log in to post a comment.