system
March 4, 2016, 8:36am
1
Attention
Topic was automatically imported from the old Question2Answer platform.
Asked By
unknown llama
Old Version
Published before Godot 3 was released.
Hello Everyone,
I’m wondering if there is a build-in way to get a user’s home directory path in Windows and Mac?
The purpose will be to store a game configuration file there. The file will be read/write.
Thank you.
system
March 4, 2016, 8:51am
4
Reply From:
Mohammad Hadi Aliakb
you can save a file in user directory by using user:\
It’s user://
, to be accurate.
Calinou | 2016-03-04 16:16
Thank you both.
unknown llama | 2016-03-05 02:58
Note that this would point to a hidden directory on OSX and Linux, and to AppData on Windows.
Bojidar Marinov | 2016-03-05 12:03
system
March 4, 2016, 2:42pm
5
Reply From:
Hinsbart
There is OS.get_system_dir(int dir)
, but it seems you can’t get the bare home directory this way, only downloads, documents etc.
I think however that it would be nice to be able to get the home folder with this function.
You can open an issue on github asking for this so an interrested contributor may implement it ^^
system
March 5, 2016, 12:30am
6
Reply From:
dragoon
This tutorial is about saving games, but it does answer your question.
Great, thank you.
unknown llama | 2016-03-05 03:00