Windows – Is there a difference between the original file and a hard link to it

hardlinkwindows

I'd like to synchronise some configuration files via a file hoster like Dropbox. I could create a hard link in the software's configuration folder and let it point to my cloud storage directory.

When having done that, is there a difference between those two files? I read somewhere that both files are attributes of the file in the master file table and that there would be no difference at all.

On the other hand, on Windows, directory junctions via mklink can be found using dir /AL /S, so they somehow differ from real directories.

Is that correct?

Best Answer

No they dont differ. A Hard link is created via mklink /H. Notice the /H switch.

I read somewhere that both files are attributes of the file in the master file table and that there would be no difference at all.

Correct.

If you ommit the /H switch, you create a junction or soft link

A junction (also called a soft link) differs from a hard link in that the storage objects it references are separate directories, and a junction can link directories located on different local volumes on the same computer. Otherwise, junctions operate identically to hard links.

via msdm

The difference between a junction and a hard link is:

  • hard links must be on the same partition. If you delete the last hard link, the file is deletet.

  • junctions can be on different volumes

Related Question