[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 the current path?

Paatsch, Bernd

2/10/2006 5:49:00 PM

Hello,

I am fairly new to ruby and wonder if there is a class/method that returns
the absolute path of the current directory (the directory I execute the ruby
script from)?


Thanks,
--Bernd

1 Answer

James Gray

2/10/2006 6:03:00 PM

0

On Feb 10, 2006, at 11:48 AM, Paatsch, Bernd wrote:

> Hello,
>
> I am fairly new to ruby and wonder if there is a class/method that
> returns
> the absolute path of the current directory (the directory I execute
> the ruby
> script from)?

I believe this is what you are after:

$ ruby -e 'p Dir.pwd'
"/Users/james"

Hope that helps.

James Edward Gray II