From: James Byrne Date: 2010-09-15T00:35:26+09:00 Subject: Re: How does one get an absolute absolute file path? Robert Dober wrote: > On Tue, Sep 14, 2010 at 5:05 PM, James Byrne > wrote: >> >> >> /home/me/projects/tmp/testing/lib/library >> >> which fails because there is no /home/me/projects/tmp/testing/lib >> directory. >> >> My question is: Is there any way to obtain the absolute path for >> __FILE__ such that it returns the path to its actual location and not >> one that includes any logical links? > > File.expand_path( File.dirname( __FILE__ )) > normally does the trick for me. > > HTH > R. This construction returns the logical link as part of the path. I want the actual file system path to the script ignoring the logical link. -- Posted via http://www.ruby-forum.com/.