Hiroaki,
Peter Weinberger has given you the deep answer based on the presumption that when you ask about comparing file paths you actually mean ‘do they represent the same file.’
If instead you mean, ‘removing dot and dot-dot or perhaps tilde-username or on some filesystems removing upper/lower case from consideration, are the two final strings representing the file paths the same’ then absolute path is good. This is what you literally asked but likely not what you mean.
One slow but sure system-independent approach to the absolute answer is to go to the final directory in each path (the last part if that is a directory or the enclosing directory if the last part is not a directory) and trace the path upward to the filesystem root. if the paths upward are identical, then so are the files (if the filenames are match in the case that the final parts are not directories). (In olden times, you could just get each file’s inode and compare.)
—
Wearality Corporation • 289 S. San Antonio Road • Los Altos, CA 94022