Tuesday, 20 November 2018

windows - What operations breaks the hardlinks?


I have a file "a.txt" and its hardlink "ha.txt". If I open either of those files in notepad and save any changes it would appear in both files as they are still linked. But if I overwrite (copy) a.txt with another file with same name the hardlink breaks. What other operations do this?


Also, can I use it to backup a folder? Since if I ever change (overwrite) "a.txt" the hardlink automatically breaks and I have 2 copies. But because it depends on what I use to overwrite it (notepad certainly won't work) it ultimately depends on what operations in windows "breaks" the hardlinks and make copies?



Answer



Anything that deletes and recreates the target file will break the link. Some applications will do this, some won't. I don't think there's any way to predict this in advance.


Hard links are not a sensible backup mechanism, since there is only ever one copy of the file. Backups should always be to a different physical disk, anyway, in case the entire disk fails.


No comments:

Post a Comment

Where does Skype save my contact's avatars in Linux?

I'm using Skype on Linux. Where can I find images cached by skype of my contact's avatars? Answer I wanted to get those Skype avat...