Omnimaga

General Discussion => Technology and Development => Computer Programming => Topic started by: c4ooo on January 03, 2016, 02:40:36 pm

Title: Standart game data folder on Linux/ OsX?
Post by: c4ooo on January 03, 2016, 02:40:36 pm
What is the standard game folder on PCs running linux/mac?
EG lets say i have a meathod creatdir(String s) that creates a dir. What would path would a pass to it on linux/OsX?
On windows it i would do createdir("forgot/<user>/documenta/Games").

Edit: Someone just told me that for linux, "creatdir("~/games")" would work, but what is the full path?
Title: Re: Standart game data folder on Linux/ OsX?
Post by: Hooloovoo on January 03, 2016, 03:06:09 pm
~/games means (user's home dir)/games, which would normally look like /home/username/games

I have more often seen game data in ~/.local/share/$programname
according to http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html (http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html), programs should use $XDG_DATA_HOME if it is set, or if it is not set, use ~/.local/share/programname