From: Luis Parravicini Date: 2010-05-15T01:58:15+09:00 Subject: Re: Problem ruby pwd in different directory On Fri, May 14, 2010 at 1:30 PM, Gianluca Rettore wrote: > Hi my problem is this > > i have a script in direcory ex > > c:\temp\pippo.rb > > this script have this code > > a= Dir.pwd() > puts a > > if i exec a script from another directory there is a problem. The script > write a path of ruby exec and not the path of script ex > > c:\nano\ruby ..\temp\pippo.rb > > => c:\nano > > > i want > > => c:\temp > > Can you help me???? Dir.pwd gives the current working directory. To get the directory of the script you are running you can use File.dirname(__FILE__) -- Luis Parravicini http://ktulu.com.ar/blog/