Sys.get_save_file() target paths (SOLVED)

Testing them now with sys.get_save_file(“appname”, “filename”)

Windows
%appdata%\Roaming\appname\filename

OS X
~/Library/Application Support/appname/filename

Linux
~/.appname/filename
BAD! This should be placed under ~/.config/appname/filename
It’s my understanding Linux users prefer this, to keep their user folder less cluttered. Solution is to maybe detect Linux target and set the “appname” part to “config/appname” if that’s possible? Edit: tested this to make sure for anyone who cares and it appears to work fine to save in ~/.config/appname/filename instead of the default dir.

iOS
/var/mobile/Containers/Data/Application/{app-uid?}/Library/Application Support/appname/filename

Android
/data/data/com.packagename/files/filename
So the first field is ignored? That’s somewhat understandable based on the inclusion of the package name in the path, but it’s inconsistent compared to others… but probably too late to change now.

HTML5
/data/.appname/filename

4 Likes

You’re right that ~/.appname is bad, but the ~/.config directory is not a standardised directory for UNIX-like operating systems. According to the Filesystem Hierarchy Standard (that we all know by heart and love), variable game data should be placed under /var/games. Before the Filesystem Hierarchy Standard was in place, it should have been placed somewhere under /usr.

Regards,
Jakob

3 Likes

I’m no Linux expert. Wouldn’t that be for shared game data and not unique to the currently logged in user?

Sorry for posting in thread marked as solved, but I don’t see it being solved.

Any updates/plans to address linux path that’s returned by sys.get_save_file?
It’s worth looking at what other engines or popular games are using for saves on Linux. Even if there’s no definitive agreement, almost anything will be better than ~/.appname IMO.

For non-steam games it’s almost always ~/.local/share/appname from my experience.

It’s not a blocking issue, as I can save to any directory manually, but this was bothering me as this is the default and cross-platform way of doing this in the engine.

No. I am not even able to find a reported issue about this. Feel free to report one though!

1 Like

Yup, I should have started with that. It’s done now:

1 Like