- From: Tor Lillqvist <tml hemuli tte vtt fi>
- To: gtk-devel-list redhat com
- Subject: g_get_home_dir, g_get_tmp_dir
- Date: Wed, 28 Oct 1998 11:50:59 +0200
I think some specification for the semantics of g_get_home_dir and
g_get_tmp_dir should be decided upon. In my gimp for Windows work, I
had assumed that g_get_home_dir can and should return an empty string
if the user has no recognisable home directory (as typically is the
case on single-user Windoze machines).
(I already have code in gimp for Windows that takes this into
consideration, and uses the gimp installation directory for per-user
rc files in that case.)
When applying the Windows patch to GLib, however, g_get_home_dir was
changed to return the same as g_get_tmp_dir always on Windows. (Becase
g_get_any_init was changed to always set g_home_dir to NULL on
Windows, even if the HOME env var exists.) (I mean, it was not like
that in my suggested patch, but TJ changed it that way.) Is this
really a good idea?
I think this is how g_get_home_dir should work:
/* Return the home directory of the user. If there is a HOME
* environment variable, its value is returned, otherwise use some
* system-dependent way of finding it out. If no home directory can be
* deduced, return an empty string.
/* Return a directory to be used to temporary files. This is the value
* of the TMPDIR, TMP or TEMP environment variables (they are checked
* in that order). If none of those exist, return "/tmp" on POSIXly
* systems, and "." (the current directory) on Windows.
] [Thread Prev