FrodeSolheim / fs-uae-launcher

A frontend for the FS-UAE Amiga emulator with support for the OpenRetro online game database.
GNU General Public License v2.0
63 stars 17 forks source link

FS-UAE fails to finds host file named % #91

Closed joonapalaste closed 3 years ago

joonapalaste commented 3 years ago

Way back in the 1990s when I still had a working real Amiga I wrote a program called % (yes, it's a percent mark). When I tried to run the program on FS-UAE running on Fedora 32 Linux (the Amiga's file system is mapped directly to the host Linux file system), I got an "unknown command" error. The program didn't show up in the directory listing either. However, the file was found all OK on the host Linux system and even vamos managed to run it by typing "vamos %". It turned out the reason for this was specifically that the program was named %. When I renamed it to percent, the file showed up in the directory listing on FS-UAE and typing "percent" on the command line ran the program all OK. Real Amigas, Linux, and vamos have no problems with a file called %. But FS-UAE fails to find it.

FrodeSolheim commented 3 years ago

Hi, this issue is specific to the % character. FS-UAE uses this as an escape character to represent filenames that cannot be represented on (all) supported host file systems. Windows / FAT being the most limited. When such filenames are created on the Amiga side, FS-UAE encodes them as %XX where XX is the hex value of the character on the Amiga.

As such, the % is treated specially, and if you want to create a file named % on the Amiga side from the host side, you need to name it %25 (Of course, if you created a file called % on the Amiga side, it will be stored as %25 on the host side without needing to do anything).

This is of course not a perfect solution, but a compromise - and it isn't a bug since it is working as I intended.