Tuesday, July 20, 2010

Point two filenames to the same file?

In Windows there are many ways to describe the same file: UNC, old 8.3 notation, relative, absolute. Unfortunately it is not trivial to detect whether two filenames are pointing to the same file. Here is some code that does this: http://blogs.msdn.com/b/vbteam/archive/2008/09/22/to-compare-two-filenames-lucian-wischik.aspx.

(Under Unix I guess one would use the inode to check this)