C # - counting and list of file hard link locations

I'm currently looking for a solution for C # that can read the number of hard links in a file and their link locations. I am thinking of a shell extension for the program that can do this by going to the file properties and listing all the hard links of one file. I expect there is a solution for C # coders that can do the same without searching the entire drive.

Edit 1:

Is there a way to check two HardLinks if they are the same file?

+3
source share
1 answer

To get the number of links, use GetFileInformationByHandleand access the element NumberOfLinks.

API VB: http://blogs.msdn.com/b/vbteam/archive/2008/09/22/to-compare-two-filenames-lucian-wischik.aspx

, FindFirstFileNameW, Vista ( Server 2k8) P/Invoke .

+2

Source: https://habr.com/ru/post/1781666/


All Articles