[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: Getting path of current script

Gavin Kistner

10/24/2006 6:09:00 PM

From: Joe Ruby MUDCRAP-CE
> Is there a simpler way to get the absolute path of the current script?
>
> path = File.dirname(File.expand_path(__FILE__))

Under some circumstances (like, you haven't changed the working
directory, and you can ensure that the working directory is the same as
the script) Dir.pwd might be all you need, right?