From: Louis J Scoras Date: 2007-03-02T23:12:23+09:00 Subject: Re: __PATH__ like __FILE__? On 3/2/07, Deniz Dogan wrote: > Hello. > I'm rather new to Ruby, so please bare with me. I just want to know if > there is anything similar to __FILE__ but which represents either the > path to the directory which __FILE__ lies in, or the __FILE__ including > the full path to the file? > > --Deniz Dogan > > Deniz; Take a look at the 'pathname' library included with ruby: http://www.ruby-doc.org/stdlib/libdoc/pathname/rdoc/classes/Pathname.html You should be able to get all that information by combining it with __FILE__: path = Pathname.new(__FILE__) p path.dirname p path.expand_path # ... -- Lou.