#385 Bug 3538050: telling whether two files are the same

Next_major_release
closed
nobody
None
7
2013-07-03
2012-06-29
No

This fixes this bug:

http://sourceforge.net/tracker/?func=detail&aid=3538050&group_id=95717&atid=612382

The problem is that you can't, in general, determine whether two files are the same by doing a string comparison of their paths (there are issues with symbolic links, etc). The MSDN documentation for GetFileInformationByHandle() suggests another method:

"You can compare the VolumeSerialNumber and FileIndex members returned in the BY_HANDLE_FILE_INFORMATION structure to determine if two paths map to the same target; for example, you can compare two file paths and determine if they map to the same directory."
( http://msdn.microsoft.com/en-us/library/aa364952%28VS.85%29.aspx )

I've attached a patch.

Discussion

  • Andreas Jonsson

    Andreas Jonsson - 2012-06-29

    New method of telling if two files are the same

     
  • Don HO

    Don HO - 2013-06-09
    • status: open --> accepted
    • Group: --> Next_major_release
    • Priority: 5 --> 7
     
  • Don HO

    Don HO - 2013-06-09

    Committed in SVN.
    Thank you for the patch.

    Don

     
  • Don HO

    Don HO - 2013-07-03
    • status: accepted --> closed
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks