On Mon, 2004-01-26 at 00:58, Bob Jamison wrote:
Then when we fix Inkscape to use relative paths to find its resources, then Win32 will reap the benefit also.
That might be easier said than done.
There's no portable way to find the absolute path of the current executable in Unix (yes, in many versions of Linux you can dig around in /proc, but that's not portable, and won't work for cases with symlinks like where stow(8) has been used).
Intuitively, abspath(argv[0]) would be sufficient, but argv[0] having anything to do with the executable path on Unix is merely a convention; there are no guarantees.
This is why all major Unix applications either:
1. use the path specified at compile-time
2. use an environment variable to find their files
3. use a wrapper shell script (shell scripts DO always have an argv[0] that points to the script)
-mental