Page 1 of 1

Save in home directory

Posted: Wed Sep 27, 2006 10:38 am
by Brujah
I want to save my savegames in the users home directory.
But simply adding "~/" to the path does not work.
How could I achieve this then?

Posted: Wed Sep 27, 2006 11:50 am
by freak
The '~' expansion is done by the shell, so it won't work with PB commands.
Use PeekS(getenv_("HOME")) to get the home dir and add it to your filenames.

Posted: Wed Sep 27, 2006 11:51 am
by Nik
You could use

Code: Select all

string.s=peekS(getenv_("HOME"))
(untested)

Posted: Wed Sep 27, 2006 11:51 am
by Nik
argh Freak your to fast, seriously

Posted: Wed Sep 27, 2006 12:44 pm
by Brujah
Okay. I tried this code. And I think that solves my problem.
Thanx!

Posted: Sun Oct 15, 2006 11:17 am
by andreyu
I think that developers should add universal function - getprofilepath().
On Linux it should return users home path (/home/users_home/).
On Windows it should return profile path (C:\Documets and settings\users_login_name\).