Re: g_get_home_dir, g_get_tmp_dir
- From: Des Herriott <des ops netcom net uk>
- To: gtk-devel-list redhat com
- Subject: Re: g_get_home_dir, g_get_tmp_dir
- Date: Wed, 28 Oct 1998 10:11:10 +0000
On Oct 28, Tor Lillqvist wrote:
> 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.
> */
Should HOME be used on a Unix system in preference to querying
someone's home directory via the UID/EUID of the process, and using
getpwuid() ?
> And g_get_tmp_dir:
>
> /* 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.
> */
What about using P_tmpdir from <stdio.h> if it's defined, rather than
/tmp? Using /tmp on Solaris, for example is a bad idea, since that's
your swap space. At the very least, "/var/tmp" should be used.
--
Des Herriott
des@ops.netcom.net.uk
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]