NTFS supports Reparse Points -- MS's name for hard links -- so it's possible to have two paths refer to the same file. There is a function you can call to get the GUID of the Reparse Point. Judging by the name, this should be unique across all devices and machines.

On a given FAT device, the path is the unique identifier (once "." and ".." are properly removed). However, it is tricky to determine whether two devices are the same (in part or in whole). Given

net use z: \\127.0.0.1\c$ net use y: \\127.0.0.1\share_c net use x: \\10.0.0.5\c$ net use w: \\tribble05\c$ subst v: c:\ net use u: \\127.0.0.1\c$\dir net use t: \\127.0.0.1\share_dir subst s: c:\dir
the following could all refer to the same file:
c:\dir\file z:\dir\file y:\dir\file w:\dir\file v:\dir\file x:\dir\file u:\file t:\file s:\file

It's even trickier once virtual drivers and shares on non-Windows machine come into play.


In reply to Re: Uniquely identifying files on windows by ikegami
in thread Uniquely identifying files on windows by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.