阅读背景:

Linux/*nix中正在运行的应用程序如何确定自己的绝对路径?

来源:互联网 

Suppose you run the application 'app' by typing 'app', rather than its absolute path. Due to your $PATH variable, what actually runs is /foo/bar/app. From inside app I'd like to determine /foo/bar/app. argv[0] is just 'app', so that doesn't help. Suppose you run the application 'app' by typing




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: