Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
要获取我发现的当前目录:
if (!getcwd(cCurrentPath, sizeof(cCurrentPath) / sizeof(char))) { lililog.log(LILILog::error,"Error getting current directory path"); }
但我需要获取正在运行的应用程序的目录。怎么做?
非常不便携的解决方案:阅读 symlink /proc/self/exe。
/proc/self/exe