Friday 24 January 2020

windows - Is there a difference between the original file and a hard link to it?


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?



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




No comments:

Post a Comment

How can I VLOOKUP in multiple Excel documents?

I am trying to VLOOKUP reference data with around 400 seperate Excel files. Is it possible to do this in a quick way rather than doing it m...