Get user's home directory

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By unknown llama
:warning: 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.

:bust_in_silhouette: 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

:bust_in_silhouette: 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 ^^

:bust_in_silhouette: 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