Specifically I have tested filenames ending in
. and ending in
? (this is the name BEFORE the usual dot and file extension).
I have a bunch of dialog strings ending in "." and "?" and I tried to automate things by using those strings as filenames. This worked fine on the Simulator, but hardware crashes with
attempted to index a nil value.
My workaround: for now I'm stripping that punctuation when saving the asset files, and in Lua, removing the final character from each string with
—— This has been "Obscure Corner Case of the Day" with your host, Morgan Adams ——
@dave any thoughts on why this might be?
Example?.PNG doesn't work because
? isn't allowed in filename on the FAT filesystem. I've filed an issue to have the simulator check for value FAT filenames, though that's pretty low priority so it's unlikely to show up any time soon.
The system doesn't like
Example..WAV because we don't allow access to parent folders and my dumb logic for checking for that was looking for
.. in filenames, not checking at all whether there are path separators next to it. The simulator should give you a warning there:
warning: access to /Example..pdi is not allowed on the device. I'll file that too, but same caveat about priority.
Maybe the only effort that's even worth it would be adding a link somewhere in Inside Playdate to the requirements of FAT filenames.
This is a good point; I will add this into the docs (though it would indeed be nice if the Simulator could detect this.)