what is the call to determine the app you are running in
Hi-
I need the cpp call that will tell me the full path to the app I'm running in. For example, I'm running in a loaded library for either mozilla or firefox, but would like to know the full path to the executable /usr/bin/firefox /usr/bin/mozilla /usr/local/firefox1_5 etc... (For windows programmers, it would be the Linux version of GetModuleFileNameW) Thanks! |
same as C isn't it?
main(int argc, char** argv) argc is no of args argv[0] is the pathname. argv[1] is arg 1 ... etc |
Hi- Thanks for the reply...
That would be true if I had a main... unfortunately I don't since I'm running in a .so. I'm looking for a function call that will give me the same information. I've now found the Mac version for the call(GetFilePathFromFSRef) but still no linux. I'm assuming it will be the same for all UNIX flavors, but maybe not. Thanks! |
probably use getuid() and read the info from /proc/$PID/cmdline and /proc/$PID/environ.Assumes a proc file system for u.
|
All times are GMT -5. The time now is 03:43 AM. |