From: Jason Voegele Date: 2003-02-10T03:47:46+09:00 Subject: Re: How to find an install directory. Daniel Carrera wrote: > Say I have "mod.rb" installed, and in "file.rb" I call it with: > require "mod" > > I need "mod.rb" to know in which directory *it* is installed. > Unfortunatelly, it interprets the current directory to be the current > directory of "file.rb", as opposed to its own. > > How can "mod.rb" find its own current directory? f = __FILE__ len = -f.length my_dir = File::expand_path(f)[0...len] -- Jason Voegele "We believe that we invent symbols. The truth is that they invent us." -- Gene Wolfe, The Book of the New Sun