Forum: Ruby Actual directory

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
125aa997aecefa6ebd4431f9b89e0bed?d=identicon&s=25 Kless (Guest)
on 2008-10-14 14:00
(Received via mailing list)
Why is used *File.dirname(__FILE__)* instead of simply '.' ?
4fc30068499179fc708fe5dec2c95919?d=identicon&s=25 Antonin Amand (Guest)
on 2008-10-14 14:09
(Received via mailing list)
On Oct 14, 1:59 pm, Kless <> wrote:
> Why is used *File.dirname(__FILE__)* instead of simply '.' ?

Cause your current directory '.' is not always the location of the
ruby file, __FILE__ is.
This topic is locked and can not be replied to.