Hi,
I am running a C program on Unix which loads a shared object of mine.
I need to get the path of my .so from inside it. I want to do this
because from my .so I want to open a text file which is in same
directory as my .so.
getcwd() obviously doesn't serve my purpose because my .so is not in
"cwd" but I am pointing my executable to it using the
LIBPATH/LD_LIBRARY_PATH.
Can somebody provide any pointers? Thanks in advance
Sug 7 1589
On 21/06/2005 14:40, sug wrote: Hi,
I am running a C program on Unix which loads a shared object of mine.
I need to get the path of my .so from inside it. I want to do this because from my .so I want to open a text file which is in same directory as my .so.
getcwd() obviously doesn't serve my purpose because my .so is not in "cwd" but I am pointing my executable to it using the LIBPATH/LD_LIBRARY_PATH.
Can somebody provide any pointers? Thanks in advance
I think it's implementation dependent. You should have a look at your
dynamic linker documentation. Maybe "man dyld" ?
On 21/06/2005 14:40, sug wrote: Hi,
I am running a C program on Unix which loads a shared object of mine.
I need to get the path of my .so from inside it. I want to do this because from my .so I want to open a text file which is in same directory as my .so.
getcwd() obviously doesn't serve my purpose because my .so is not in "cwd" but I am pointing my executable to it using the LIBPATH/LD_LIBRARY_PATH.
Can somebody provide any pointers? Thanks in advance
Sug
Hi Jean,
Thanks. I am not sure but I guess "dyld" is a utility right?
I need to do it from my code, I probably need a function that I can
call from C. Or you were poining at doing system("dyld")?
Thanks, Sug
On 21/06/2005 15:01, sug wrote: Hi Jean,
Thanks. I am not sure but I guess "dyld" is a utility right? I need to do it from my code, I probably need a function that I can call from C. Or you were poining at doing system("dyld")?
Thanks, Sug
No, actually, dyld is the dynamic linker on my platform, I don't know its
name on yours. Basically, it's the program that loads executables and ".so"
files, and it provides functions to access the object "headers", which
provide many important informations. On your platform I suppose there is
something similar.
On 21/06/2005 15:09, Jean-Claude Arbaut wrote:
On 21/06/2005 15:01, sug wrote:
Hi Jean,
Thanks. I am not sure but I guess "dyld" is a utility right? I need to do it from my code, I probably need a function that I can call from C. Or you were poining at doing system("dyld")?
Thanks, Sug
No, actually, dyld is the dynamic linker on my platform, I don't know its name on yours. Basically, it's the program that loads executables and ".so" files, and it provides functions to access the object "headers", which provide many important informations. On your platform I suppose there is something similar.
To be more explicit: these functions are available in C programs.
Jean-Claude Arbaut wrote: On 21/06/2005 15:09, Jean-Claude Arbaut wrote: On 21/06/2005 15:01, sug wrote:
Thanks. I am not sure but I guess "dyld" is a utility right? I need to do it from my code, I probably need a function that I can call from C. Or you were poining at doing system("dyld")?
No, actually, dyld is the dynamic linker on my platform, I don't know its name on yours. Basically, it's the program that loads executables and ".so" files, and it provides functions to access the object "headers", which provide many important informations. On your platform I suppose there is something similar.
To be more explicit: these functions are available in C programs.
And, instead of cluttering up c.l.c with 4 or more off-topic
replies, you could have limited yourself to one setting followups
to a more appropriate newsgroup. The fact that the OP failed to do
so is no excuse.
--
Some informative links:
news:news.announce.newusers http://www.geocities.com/nnqweb/ http://www.catb.org/~esr/faqs/smart-questions.html http://www.caliburn.nl/topposting.html http://www.netmeister.org/news/learn2quote.html This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: John Roth |
last post by:
I'm adding a thread for comments on Gerrit Holl's pre-pep, which
can be found here:
http://tinyurl.com/2578q
Frankly, I like the idea. It's about time that all of the file
and directory stuff...
|
by: Vincenzo Davi |
last post by:
I have created a dll with several classes in C#. One of the classes
references image files in the subdirectories of the bin/Release folder
(basically where the dll resides).
Now, I want to use...
|
by: tshad |
last post by:
I just put this together from O'Reillys book (with much of the code stripped
out).
Global.asax:
******************************************
<%@ Application Language="VB" %>
<script...
|
by: bryan |
last post by:
Is there any way I can get the application path (the one returned by
Request.ApplicationPath) in the Application_Start method in
Global.asax? Request is not valid there. On a related note, is there...
|
by: Hitesh |
last post by:
Hi,
I have a small script here that goes to inside dir and sorts the file
by create date. I can return the create date but I don't know how to
find the name of that file...
I need file that is...
|
by: Tom |
last post by:
I have a function that restricts access to a page to logged in users.
When a user who isn't logged in goes to the page, it will dynamically
generate a login form.
I'm trying to use it in...
|
by: Dave |
last post by:
The below code is what I'm using to upload JPG's to a Shared folder on
my web server. The folder \\GLSDBS03\Entry$ is outside my Web folder.
When using FileUpload, and trying to save the JPG, I...
|
by: buntyindia |
last post by:
Hi,
I have a very strange problem with my application.
I have developed it using Struts.
I have a TextBox With Some fixed value in it and on Submit iam passing it to another page.
<html:form...
|
by: moondaddy |
last post by:
I'm posting code for a user control ( FunctionConnectorSelector) below which
has 3 content controls in it. each content control uses a style from a
resource dictionary merged into the app.xaml...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |