From: Joel VanderWerf Date: 2005-02-22T04:42:03+09:00 Subject: Re: Require when Executed file is required by another file. Zev Blut wrote: > A coworker of mine just commented why not just use File.expand_path for > the required file? Is there any reason not to do this? Symlinks... $ cd /tmp $ touch foo $ ln -s foo bar $ ruby -e 'p File.expand_path("foo")' "/tmp/foo" $ ruby -e 'p File.expand_path("bar")' "/tmp/bar" It might not be very portable, but there is File::Stat#ino: $ ruby -e 'p File.stat("foo").ino' 1239183 $ ruby -e 'p File.stat("foo").dev' 776 $ ruby -e 'p File.stat("bar").ino' 1239183 $ ruby -e 'p File.stat("bar").dev' 776