dwk
Seek and ye shall find. quaere et invenies.
"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell
Other boards: DaniWeb, TPS
Unofficial Wiki FAQ: cpwiki.sf.net
My website: http://dwks.theprogrammingsite.com/
Projects: codeform, xuni, atlantis, nort, etc.
Ok, so you probably need to use opendir()/readdir()/closedir() to open/read/close the directory entry then. Unfortunately, you won't be able to spawn a process and use something like a "ls | awk ..." or "ls | sed ...", since you would then get the path to "ls", rather than your application, which I assume is what you are actually after [although I suppose the stuff is also in a numbered process /proc/<pid>/exe (or similar) directory, so I suppose that would be possible to use for such scripting tricks].
Edit: Note that you would have to do (pseudo-code)Code:x = opendir("\proc\self"); while(readdir(dirinfo)) { if (dirinfo.fname == "exe") { getlinkcontent(); break; } } closedir(x);
--
Mats
Last edited by matsp; 04-09-2008 at 05:53 PM. Reason: Clarify/example.
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.