From: Brian Candler Date: 2010-01-03T03:45:19+09:00 Subject: Re: How to get the directory of the current script? Phillip Gawlowski wrote: > On 02.01.2010 03:33, Kimball Johnson wrote: >> As to getting the parent directory of a file, try this: >> >> File.dirname(File.dirname(__FILE__)) >> >> or for the absoluter path: >> >> File.expand_path(File.dirname(File.dirname(__FILE__))) >> >> dumb but smart? > > require "futils" > puts Dir.pwd Note 1: the process's current working directory is in general unrelated to the directory where the script itself is located. Note 2: you don't need to load any library to get access to Dir.pwd -- Posted via http://www.ruby-forum.com/.