Paolo Bonzini wrote:

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.

GNU libraries/utilities are likely to provide support for the earliest OSes, and libdl was absent till (I don't know which version exactly, 10.3 or 10.4). Somebody has implemented libdl interface on top of Mach API, and it became part of Mac OS X.

I would better use libdl interface because Apple will care about it in the future OSes, but Mach API is sometimes being dropped (like it happened to _NSGetExecutable) or changed.

Proper handling of Mac OS X 10.2 - 10.6 would require using either system libdl or built-in one in the abscence of system one.

--
If you want to get to the top, you have to start at the bottom



Reply via email to