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!
On Fri, May 14, 2010 at 1:30 PM, Gianluca R.
[email protected] wrote:
=> 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 P. wrote:
On Fri, May 14, 2010 at 1:30 PM, Gianluca R.
[email protected] wrote:
=> 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)
Yessss Thank you very much! now is all ok!

On Fri, May 14, 2010 at 11:30 AM, Gianluca R.
[email protected]wrote:
=> 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