in reply to Re: Testing if two paths point to the same file.
in thread Testing if two paths point to the same file.

Will that work for hard links?
  • Comment on Re^2: Testing if two paths point to the same file.

Replies are listed 'Best First'.
Re^3: Testing if two paths point to the same file.
by ikegami (Patriarch) on Jan 30, 2009 at 15:29 UTC
    Technically, ".." is a hard link. But in general, no.
    $ touch foo $ ln foo bar $ perl -MTest::More=no_plan -MCwd=realpath -e ' is(realpath($ARGV[0]), realpath($ARGV[1])) ' foo bar not ok 1 # Failed test at -e line 2. # got: '/home/eric/foo' # expected: '/home/eric/bar' 1..1 # Looks like you failed 1 test of 1.