From: Josh Cheek Date: 2010-05-15T11:25:56+09:00 Subject: Re: Problem ruby pwd in different directory --00163683351edb8405048698a9b5 Content-Type: text/plain; charset=ISO-8859-1 On Fri, May 14, 2010 at 11:30 AM, 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???? > > Thank you in advance! > -- > Posted via http://www.ruby-forum.com/. > > Hi, not entirely sure why you need the directory the same as the file, but every time I've needed that, it had to do with relative positioning of files. If that's the case for you, then you might check out this blog entry, which I found pretty helpful http://tomafro.net/2010/01/tip-relative-paths-with-file-expand-path --00163683351edb8405048698a9b5--