Possible Duplicate:
Best way to determine if two path reference to same file in C/C++
Given two file path strings with potentially different casing and slashes ('\' vs '/'), is there a quick way (that does not involve writing my own function) to normalize both paths to the same form, or at least to test them for equivalence?
I’m restricted to WinAPI and standard C++. All files are local.
Depending on whether the paths could be relative, or contain ‘..’, or junction points, or UNC paths this may be more difficult than you think. The best way might be to use the GetFileInformationByHandle() function as in this answer.
Edit: I agree with the comment by RBerteig that this may become hard to impossible to do if the paths are not pointing to a local file. Any comment on how to safely handle this case would be greatly appreciated.