Say you are writing a C/C++ program and from within that program you need to find the path of the exe file. Under *nix systems. Get the pid, "int pid = getpid();" then simply the file "/proc/pid/exe" is a link to the executable. From there you can do whatever you want. You can also find a bunch of other information about your process in the "/proc/pid/" directory.
Come back for more tomorrow :).
Sunday, December 4, 2011
Subscribe to:
Post Comments (Atom)
1 comment:
G
Post a Comment