I am running the application by double clicking the file, so getcwd API takes the running path as root directory. But i am running the application from different path. How to get the correct path of running application in linux c++. Please help Thanks in advance
Asked
Active
Viewed 97 times
0
-
1http://stackoverflow.com/questions/606041/how-do-i-get-the-path-of-a-process-in-unix-linux try searching before posting a question. – user93353 Apr 01 '13 at 04:48
-
This should help you: http://stackoverflow.com/questions/273691/using-progname-instead-of-argv0 – mvp Apr 01 '13 at 04:50
-
So `readlink(2)` the `/proc/self/exe` pseudofile – Basile Starynkevitch Apr 01 '13 at 07:33
-
Thanks to all. readlink is working to get the application running path – SPL Apr 01 '13 at 11:10