34 #include <linux/limits.h> 55 char execution_path[PATH_MAX + 1] = {0};
56 ssize_t st = readlink(
"/proc/self/exe", execution_path, PATH_MAX);
59 throw std::runtime_error(
"Couldn't open /proc/self/exe");
62 char * mydir = dirname(execution_path);
63 return std::string(mydir);
std::string findHome()
Find the directory in which the calling program resides.