This is basically the same philosophical problem as determining whether two URLs point to "the same page". You can't really tell.
You can check the device and inode field of the results of stat for both directories, but that will only work for file systems that follow the idea the inventors originally had. This likely won't detect file systems that are mounted in two separate places into the same directory tree and won't work where the inode field is always empty or zero.
You can readdir the directories and consider them to be the same if they contain the same files. Possibly you can also check and compare the sizes and timestamps of all directory entries.
But in the end, you can never be exactly sure.
In reply to Re: Finding out whether two directories are the same
by Corion
in thread Finding out whether two directories are the same
by rovf
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |