views:

410

answers:

1

I'm running Ruby on Windows though I don't know if that should make a difference. All I want to do is get the current working directory's absolute path. Is this possible from irb? Apparently from a script it's possible using File.expand_path(FILE)

But from irb I tried the following and got a "Permission denied" error:

File.new(Dir.new(".").path).expand
+4  A: 

Dir.pwd seems to do the trick.

http://ruby-doc.org/core/classes/Dir.html#M002316

to quote Homer: doh!
George Jempty