in reply to Uniquely identifying files on windows

You can calculate a checksum, e.g. using the Digest::MD5 module.


holli, /regexed monk/

Replies are listed 'Best First'.
Re^2: Uniquely identifying files on windows
by VSarkiss (Monsignor) on Dec 29, 2005 at 20:27 UTC
      Yes, but there is no such thing like an "ununique" file under windows (except you can have hard links, but I have never seen a real life usage of that).


      holli, /regexed monk/
        Not sure about uses for hard links on Windows, but I do know a little about junction links (a.k.a. reparse points). They are similar to symbolic links to a directory on UNIX. Except that barely anything actually understands them so you have to be very, very careful. For example 'rm' on UNIX would delete the symbolic link. But on Windows doing the equivalent usually blindly follows the junction link. The Junction Link Magic website has some more information and provides an interface to make use of them (Windows certainly doesn't).

        I have not seen it mentioned anywhere but I believe junction links are also used when mounting to a directory. When I was running out of disk space once I moved all of my graphics stuff off to a new drive and then mounted that to the old (now empty) directory to avoid breaking applications. Later on I started using Junction Link Magic. When I did a system scan for junction links my "mounted to a dir" filesystem showed up. Perhaps that is why Microsoft created them. Now if the rest of the OS/shell would understand them....

        Note: If you want to account for junction links then using the full path to determine uniqueness would not work since a unique file can potentially be accessed from two or more different paths.

        -- Argel