|
| santaris (6) | |
| Hello.Is there any function to get the exact path where the executable is even if the executable path changes.I mean that i run the executable in a different path everytime.Thanks in advance. | |
| Zaita (2112) | |||
Yes.
| |||
| xcoder (9) | |
| I assume that you're running linux! Then just type path = system("echo $PWD"); and your path will hold the current directory where executable is! Just try it in your terminal type echo $PWD you'll see! | |
| chrisname (1342) | |
| Don't use the "system()" function. Do it the way Zaita showed you. Possibly you could pipe the output of something like "ls" with a childprocess and execvp or something, but Zaitas way is already there and probably better. | |
| xcoder (9) | |
| Probably! | |
This topic is archived - New replies not allowed.
