For hard links, you can't do what you want. This Stack Overflow answer[^] explains why:
Quote:
On NTFS all files are hard links. You can detect that a file has multiple hard links pointing to it, but there's no "real file" that it points to. You can think of hard links as just different names for the same file.
So for example if you have file1.txt and you create a hard link file2.txt that points to the first file, both are hard links and the 'target' is the data on your disk. What you can do, is detecting if a file is a symbolic link: c# - Check if a file is real or a symbolic link - Stack Overflow[^]
The quick brown ProgramFOX jumps right over the Lazy<Dog>.