Re: Proposal: an addition to glib for getting the absolute path of the current binary.
- From: John Cupitt <john cupitt ng-london org uk>
- To: gtk-devel-list gnome org
- Subject: Re: Proposal: an addition to glib for getting the absolute path of the current binary.
- Date: Tue, 13 Apr 2004 19:33:01 +0000
Mike Hearn wrote:
It would be nice if glib could provide something like the following API:
gboolean g_get_absolute_path(gchar *fallback, gchar **out);
which takes a fallback string (typically would be the PREFIX macro as
defined by the build system on UNIX) and a pointer to a pointer which is
set either to be g_strdup(fallback) on systems where this information is
not available, or the absolute path of the calling module on systems where
I this this is a great idea, I've had to make my own (rather poor) equivalent several times in the past. A high-quality glib version would be great.
I'd vote for PATH searching to go in there too, although I realise it can be unreliable.
A related issue is embedding environment variables in data files so they can refer to other data files. How about adding something to glib which could expand environment variables in a string?
] [Thread Prev