Author Topic: Standart game data folder on Linux/ OsX?  (Read 3270 times)

0 Members and 1 Guest are viewing this topic.

Offline c4ooo

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 252
  • Rating: +10/-1
  • The impossible chemical compound.
    • View Profile
Standart game data folder on Linux/ OsX?
« 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?
-German Kuznetsov
The impossible chemical compound.

Offline Hooloovoo

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 225
  • Rating: +22/-0
    • View Profile
Re: Standart game data folder on Linux/ OsX?
« Reply #1 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, programs should use $XDG_DATA_HOME if it is set, or if it is not set, use ~/.local/share/programname
"My world is Black & White. But if I blink fast enough, I see it in Grayscale." -tr1p1ea
Spoiler For some of the calcs I own:



(actually I have quite a few more than this, but I don't feel like making bars for them all.)