Getting a users home directory

BlitzMax Forums/BlitzMax Beginners Area/Getting a users home directory

Lomat(Posted 2005) [#1]
Hi,

Does anybody know of a way to get the current users home directory (cross platform). Since all platforms are now multi user it would be nice to be able to save the application configuration files in the users home directory.


Perturbatio(Posted 2005) [#2]
in WinXP you can get the HOMEPATH directory with
GetEnv_("HOMEPATH")

in Linux, I think it's just HOME the same *should* go for OSX.


xlsior(Posted 2005) [#3]
Under windows:
GetEnv_("HOMEPATH")

Under Linux your homedirectory will always be: ~/
(A virtual path which always points to your homedir)
Since OSX is based on a unix as well, I'm pretty sure that the same goes for the Mac.

(so "~/somefolder" would point to the somefolder subbdirectory under your homedir...)

You can use the ?win32 / ?linux etc. directives to put the correct homedir in a variable.