Access local resources > getenv("LD_ LIBRARY_PATH")

I wanted to share a trick I didn’t see on AppImages website, when preparing an appImage for freewrl.sf.net using the Manual approach:
I was looking for where to store local resources not compiled in -in my case font files- and found a trick that seemed to work from main.c:
char * libpaths = getenv(“LD_LIBRARY_PATH”);
And that returned a long string containing:
/tmp/.mount_freewrz81ycQ/usr/lib/:
/tmp/.mount_freewrz81ycQ/usr/lib/i386-linux-gnu/:
/tmp/.mount_freewrz81ycQ/usr/lib/x86_64-linux-gnu/:

So I took the first of those, stripped the /lib/: and added my resource folder path /fonts and used that in my program as an absolute path to the fonts, put my fonts there in .AppDir and it worked. Q. how reliable is that?

Please use paths relative to the main executable. Using LD_LIBRARY_PATH to find out where your main executable is is not reliable.

Please see