[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

How to find directory of currently running .rb file

Kenneth McDonald

10/27/2008 7:01:00 PM

__FILE__ is just giving me the file name, with no path, and Dir.getwd
is giving me an error: "ENOENT: No such file or directory." What is
the proper way to get this info?

Thanks in advance,
Ken McDonald

1 Answer

Brian Candler

10/27/2008 9:18:00 PM

0

Kenneth McDonald wrote:
> __FILE__ is just giving me the file name, with no path, and Dir.getwd
> is giving me an error: "ENOENT: No such file or directory." What is
> the proper way to get this info?

File.dirname(__FILE__)
--
Posted via http://www.ruby-....