Re: how to detect a hard link in Java?






> Now there is a file that is known by the names "foo" and "bar", and
> neither of them is its original name. Which should be the canonical
> name? Maybe "bar" because it is alphabetically earlier. The aliases
> might be in different directories, and then a shorter path might be
> more canonical.

Unix does not have a concept of a canonical filename. As a matter of
fact the file and its name are two separate things.

Java does. The javadoc for getCanonicalPath says its definition is
system dependent. But my experience on Linux and the hints is javadoc
suggest it does not have anything to do with the links to the file.

.



Relevant Pages