I want to open a number of files (log4cxx configs, other logs etc) relative to binary's location.
Unfortunately, both getwd()
and getcwd()
are giving me the directory, from which I try to run binary at known path, instead of giving me the path where the binary is located (and where the data is).
How to get the app's path to use it with chdir()
? Any methods besides argv[0]
and without trying to parse /proc/$PID/ (that's not portable enough)?