I'm writing a set of perl scripts to help me manage a large collection of files (digital images). Quite often, to save disk space, I have a single picture listed in different directories by using NTFS hardlinks. However, I still have files that are just copies/duplicates from before I discovered NTFS can do hardlinks..
My problem is, I need to be able to check if a duplicate file (I can already detect if a file is a duplicate, identical data) is really a duplicate/copy of the file, or just another hardlink. I have the HLSCAN.EXE utility from Microsoft, which is supposed to tell me.. But while testing it, it does not seem to work. I created a test directory where a1.txt and a2.txt are hardlinks to the same file, and a3.txt is a copy of the file, but not a hardlink. Here's the output:
[code:1:f7b684e893]F:\Test>hlscan /file "a1.txt" "a2.txt" "a3.txt" /log
Commands available are:
* hlscan [/log [location]]
Scans the current volume.
* hlscan /all [/log [location]]
Scans all NTFS volumes on the local system.
* hlscan /file <file names> [/log [location]]
Scans only files specified by <file names> (non recursively)
* hlscan /?
Print this help.
[/log [location]] is an optional switch to log the results
to a file in addition to printing them on the screen.
"Location" defaults to Hlscan.log in the current directory.
F:\Test>[/code:1:f7b684e893]
As you can see, HLSCAN.EXE doesn't seem to work.. Does anyone know of any utilities (or other perl scripts/modules) which can help? Or even perhaps some way to find out a file's filesystem node/id so I can compare them manually?
You are about to answer a thread that has been inactive for more than 6 months. If you still wish to proceed, please ensure that your posting is original and does not duplicate or overlap any prior responses to this thread.