The equal function only compares path strings. So, if file A is /some/path and file B is /some/path/more/.., they will not be "equal".
The isCanonicallyEqualTo extension function should compare 2 files whereby, in the event the path of each file is not the same, will hit both with canonicalFile() and compare them. In the event an IOException is encountered (possible with canonicalFile), then absoluteFile.normalize() should be fallen back to to compare.
The
equal
function only compares path strings. So, if file A is/some/path
and file B is/some/path/more/..
, they will not be "equal".The
isCanonicallyEqualTo
extension function should compare 2 files whereby, in the event thepath
of each file is not the same, will hit both withcanonicalFile()
and compare them. In the event anIOException
is encountered (possible withcanonicalFile
), thenabsoluteFile.normalize()
should be fallen back to to compare.