[lokisetup] symlink paths

Clement Bourdarias cbour at mangoquest.org
Thu Jul 25 16:46:29 EDT 2002


Yes, you can look for which file (bin or link) was launched (you can look
at the PATH variable with getenv("PATH")), and then use the readlink()
function to see if it is a link, and in that case, get the path of the bin
it links to, and do a chdir to it.

If you want an example, you can look at the sources of the Anvil of
Thyrion  gtk launcher (I've put the interinsting file here:
http://icculus.org/~phneutre/launch_bin.c)

Hope that helps,
Clement.

-- 
Clement Bourdarias
cbour at mangoquest.org
http://icculus.org/~phneutre

> clicking the menu item or clicking
> play in the menu launches the symlink, which then causes my
> get_absolute_path() function to return paths in the symlinks directory,
> where the data needed is not.
> 	is there a way to test to see if my program was run from a
> 	symlink, and
> if so, find out where that symlink points?



More information about the Lokisetup mailing list