>> For programs' resources instead the resources should be found in a path
>> related to the program's path. You can also use the relocatable.c file
>> here. In general, this part is easier to do since most platforms
>> including Mac OS X have a way to find the executable.
>>
> _NSGetExecutable returned garbage last time I used it, so I'd favour the
> same method as for libraries: libdl.
On Tiger I get:
(gdb) p (char *) malloc(256)
$1 = 0x4009a0 ""
(gdb) p (int *) malloc(4)
$2 = (int *) 0x400aa0
(gdb) set *$2 = 256
(gdb) p (int) _NSGetExecutablePath ($1, $2)
$3 = 0
(gdb) p $1
$4 = 0x4009a0 "/sw/bin/ls"
Paolo