You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A colon is perfectly valid in most Linux filesystem names, but not in Windows, and probably not on Linux using a M$ filesystem (remains to be tested). Same for names with trailing blanks.
Unciv does not handle that nicely, in part because the underlying libraries fail to do their job.
Steps to Reproduce
Load or start a game
Ctrl-S, enter "Foo : Bar" as name, save it.
Try to delete that game (Now under "Foo " but you don't easily see the space) - nope
Try to load that game - fails with the big popup
Screen becomes less unusable because the full stack trace bloats up the error label and pushes out the right-side buttons
Screenshots
No response
Link to save file
No response
Operating System
Android
Additional Information
No particular order:
Windows itself still fails spectacularly for files with trailing blanks:
* del "Foo " fails, and not everybody knows that:
* del \\?\"<absolute-path>\Foo " is the only way (excepting third-party software) to delete such a file.
Writing to a file: The FileHandle still correctly contains the name "Foo : Bar", but writeString fails silently, creating a file with a different name than ordered. No exception thrown, just insubordination.
Reading: The FileHandle correctly shows the trailing blank, but fails actual read operations, exists or delete.
Gdx FileHandle.list() will return FileHandle entries whose exists() is false.
All this may not be the fault of Gdx or the underlying Java libraries, but it is their job to nivellate platform idiosyncracies, no?
Unciv trying to handle a FileNotFoundException in getLoadExceptionMessage seems pointless: Gdx wraps all exceptions in a GdxRuntimeException: see here.
(We would see that Exception if we replaced gameFile.readString(Charsets.UTF_8.name()) with InputStreamReader(FileInputStream(gameFile.file()), Charsets.UTF_8.name()).readText())
Leading blanks work just fine, even though Windows explorer still has some difficulties (not as crass as trailing blanks though)
Before we do platform-specific file name vetting: Anybody wants to add any more observations / ideas / bad examples? (e.g. what about the syntax to access NTFS alternate streams?)
Resolution to this one-day-late April fools joke:
Oh wait the colon is the NTFS alternate streams syntax! Simplest solution is probably to guard against colons and trailing blanks over all platforms.
The text was updated successfully, but these errors were encountered:
Is there an existing issue for this?
Game Version
from current source
Describe the bug
A colon is perfectly valid in most Linux filesystem names, but not in Windows, and probably not on Linux using a M$ filesystem (remains to be tested). Same for names with trailing blanks.
Unciv does not handle that nicely, in part because the underlying libraries fail to do their job.
Steps to Reproduce
Screenshots
No response
Link to save file
No response
Operating System
Android
Additional Information
No particular order:
*
del "Foo "
fails, and not everybody knows that:*
del \\?\"<absolute-path>\Foo "
is the only way (excepting third-party software) to delete such a file.FileNotFoundException
ingetLoadExceptionMessage
seems pointless: Gdx wraps all exceptions in aGdxRuntimeException
: see here.gameFile.readString(Charsets.UTF_8.name())
withInputStreamReader(FileInputStream(gameFile.file()), Charsets.UTF_8.name()).readText()
)Before we do platform-specific file name vetting: Anybody wants to add any more observations / ideas / bad examples? (e.g. what about the syntax to access NTFS alternate streams?)
Resolution to this one-day-late April fools joke:
Oh wait the colon is the NTFS alternate streams syntax! Simplest solution is probably to guard against colons and trailing blanks over all platforms.
The text was updated successfully, but these errors were encountered: