Deverill Posted June 30, 2006 Posted June 30, 2006 Does anyone here have some experience with Unix/Linux and C programming (or C++) that can answer this? Given program named "e" that can be run with /usr/bin/e (or whatever path), ./e, ../e, or just plain e if it's in a directory in the path. How does that program find out it's full pathname? Any help appreciated! Quote
TCH-Bruce Posted June 30, 2006 Posted June 30, 2006 Don't know if this will help or not but I found it searching Google. Quote
Deverill Posted June 30, 2006 Author Posted June 30, 2006 I can't try it till I get home, but thanks Bruce! It's a different approach than the ones I found using the /proc/PID directory. In this particular application and due to security issues /proc is unavailable. I've bookmarked that site too so the benefits will continue. Thanks for the help! Quote
Deverill Posted July 1, 2006 Author Posted July 1, 2006 Unfortunately, that's using function calls that only exist in Windows. Back to Google for me... Quote
Deverill Posted July 3, 2006 Author Posted July 3, 2006 I found a solution! I'm posting it here so anyone else that is seeking the same thing and stumbles across this post can have it: [To my friend]I found this module that is 20K of public domain code that says it will do just what you are looking for! I compiled it on Ubuntu and it worked perfectly!!! Yay!!! Hope it works out for you. I know how frustrating it is for us programmers to want to do something we can't! http://autopackage.org/docs/binreloc/ has the code. Just compile, add a switch to the original code and there you have it. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.