When copy right in folder compare, all hardlinks are changed

Open discussion about WinMerge.

When copy right in folder compare, all hardlinks are changed

Postby vinix » Thu Jul 18, 2019 5:04 am

Hello, I have a folder(FolderV1) with subfolders and files, on a NTFS volume. Then I created a hardlink clone(FolderV2), which means that all files in FolderV2 are hardlinks of files in FolderV1.

Now I got a folder UPDATE, which conatins some updated files of FolderV1. I use WinMerge to compare UPDATE and FolderV2, then copy-right some files from UPDATE to FolderV2. Then I found that corresponding files in FolderV1 are also replaced.

I thought WinMerge would replace(delete then copy) the files in FolderV2, which would break the hardlinks and make files in FolderV2 independent, but WinMerge seems edited the files and thus influence all hardlinks.

Is it by design?
vinix
 
Posts: 1
Joined: Thu Jul 18, 2019 4:26 am

Re: When copy right in folder compare, all hardlinks are cha

Postby LongtimeUser » Fri Jul 26, 2019 11:55 pm

vinix wrote:Hello, I have a folder(FolderV1) with subfolders and files, on a NTFS volume. Then I created a hardlink clone(FolderV2), which means that all files in FolderV2 are hardlinks of files in FolderV1.

Now I got a folder UPDATE, which conatins some updated files of FolderV1. I use WinMerge to compare UPDATE and FolderV2, then copy-right some files from UPDATE to FolderV2. Then I found that corresponding files in FolderV1 are also replaced.

I thought WinMerge would replace(delete then copy) the files in FolderV2, which would break the hardlinks and make files in FolderV2 independent, but WinMerge seems edited the files and thus influence all hardlinks.

Is it by design?


You are mistaken about what you have done. It is not possible to create a hard link to a directory. FolderV2 cannot be a hard link.

Yes, it is by design. It has to do with how filesystems work, and has nothing to do with WinMerge.

Some useful references for you to better understand what is happening...

Why are Hard Links to Directories Not Allowed

What Is the Difference Between a Symbolic Link and a Hard Link

Hard Links and Junctions - Windows applications | Microsoft Docs
LongtimeUser
 
Posts: 11
Joined: Fri Jul 26, 2019 10:11 pm


Return to Open Discussion

Who is online

Users browsing this forum: No registered users and 2 guests

cron