[WIN32; BUG or SHORTCOMING?] Game.FileName returns a MS-DOS style name.

Started by Sslaxx, Tue 25/10/2011 15:48:32

Previous topic - Next topic

Sslaxx

So, I've decided to use the filename of the game being played with a screenshot number appended to the end of it to allow for uniquely named, uniquely numbered (ish) screenshots. Currently using Game.FileName simply because it won't have the same issues as Game.Name would (namely, no illegal in filename characters).

However, I'm coming across what I'm leaning more towards being a legacy shortcoming of AGS, rather than a bug per-se. The filename being reported by Game.FileName is an old-style MS-DOS 8.3 name. This means that something called ControlModes.exe results in screenshot filenames containing CONTRO~1.EXE. I suspect this issue would not exist in Linux runtimes, but I'm not at this moment sure (can anyone confirm/deny?).

Is this fixable in future versions of AGS? It wouldn't be hard to code workarounds for Game.Name, certainly, so it's not exactly an issue, just something I'm curious about.
Stuart "Sslaxx" Moore.

Gilbert

I'm thinking of this. One problem is that the String system in AGS probably doesn't supported extended characters (like double byte ones). If the game name contains such characters the engine may create some error if such a String is accessed.

Sslaxx

As I said, it wouldn't be hard to code workarounds for that (a function to strip out any illegal characters, for one). But Game.Name can be changed as well, where Game.FileName can't, which is why I decided to lean more towards the latter, but the truth is that neither are ideal. A best bet might be to have a variable set on start up with the initial contents of Game.Name, but using a function to strip out any characters illegal in a filename.
Stuart "Sslaxx" Moore.

SMF spam blocked by CleanTalk