locate oci8.rb

  • Thread starter Rémi Lavergne
  • Start date
R

Rémi Lavergne

Hello,

I need to be able to dynamically locate the file oci8.rb from a sh
script...
Do you have any idea how to do this ?

Many Thanks,

R.
 
R

Robert Klemme

I need to be able to dynamically locate the file oci8.rb from a sh
script...
Do you have any idea how to do this ?

find / -type f -name oci8.rb

robert
 
R

Rémi Lavergne

Robert said:
find / -type f -name oci8.rb

robert


Hum... My question was not precise enough. I am looking for the location
of the particular oci8.rb file that my current ruby interpreter is
using. As it has to be done at each execution of my program, I would
like to avoid scanning the entire file system. My ruby interpreter is
able to locate it, I would like to be able to do the same either in ruby
or in sh script. Any idea ?

Thanks,

R.
 
S

Sylvain Joyeux

My ruby interpreter is
able to locate it, I would like to be able to do the same either in ruby
or in sh script. Any idea ?
The interpreter searches the file in directories defined in $LOAD_PATH.
You can do the same ...

location = $LOAD_PATH.find { |dirname| File.exists?(File.join(dirname, filename) }

Sylvain
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
474,270
Messages
2,571,349
Members
48,036
Latest member
nickwillsonn

Latest Threads

Top