I'm not looking to test if two files are duplicates, I know you can do that by doing a byte by byte comparison, or hashing both files.
What I'm looking for is a way to test if both files are literally the same file. For example:
c:\documents and settings\bla.txt
c:\docume~1\bla.txt
When comparing the strings, those might be seen as two different files, when really they're the same file. I could convert both strings to short file names, but I'm not sure if Windows has other ways of linking files to eachother.
In brief, I need a foolproof way to test if two files are the same file or different.
Question
+Xinok Subscriber²
I'm not looking to test if two files are duplicates, I know you can do that by doing a byte by byte comparison, or hashing both files.
What I'm looking for is a way to test if both files are literally the same file. For example:
c:\documents and settings\bla.txt
c:\docume~1\bla.txt
When comparing the strings, those might be seen as two different files, when really they're the same file. I could convert both strings to short file names, but I'm not sure if Windows has other ways of linking files to eachother.
In brief, I need a foolproof way to test if two files are the same file or different.
Link to comment
https://www.neowin.net/forum/topic/349791-c-test-if-two-files-are-the-same/Share on other sites
21 answers to this question
Recommended Posts