Jump to content

Recommended Posts

Posted

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!

Posted

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!

Posted

Unfortunately, that's using function calls that only exist in Windows. Back to Google for me... :)

Posted

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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...