+Problems with CopyLinks option
Moderators: Hacker, petermad, Stefan2, white
- ghisler(Author)
- Site Admin
- Posts: 50541
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Currently if there is a hard link, it will be skipped.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
I don't see anything skipped.
If source is hardlink, it's treated as normal file and its content is copied. It's fine, because TC does not support hardlinks.
If previously existing target is hardlink, it's overwritten and it changes also other linked files:
Using TC, copy newfile.txt to hardlink.txt, confirm overwrite and then check content of testfile.txt - it also contains "new". This might be unexpected for user.
If source is hardlink, it's treated as normal file and its content is copied. It's fine, because TC does not support hardlinks.
If previously existing target is hardlink, it's overwritten and it changes also other linked files:
Code: Select all
echo testfile > testfile.txt
mklink /h hardlink.txt testfile.txt
echo new > newfile.txt
- ghisler(Author)
- Site Admin
- Posts: 50541
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
-
- Power Member
- Posts: 872
- Joined: 2013-09-04, 14:07 UTC
You got either the wrong understanding of the "copy" semantics with respect to the Windows OS, or you confuse hard links with directory junctions.Sob wrote: If source is hardlink, it's treated as normal file and its content is copied. It's fine, because TC does not support hardlinks.
If you want to copy a file, you want to make a duplicate of the file at another location. It does not matter how the file is represented internally in the file system.
If you want to create another hard link to the same file at a different location, you would need to create another hard link.
Different copy semantics for hard links don't make sense in Windows, because for all practical purposes they are indistinguishable from files/directories.
Hard links are not identified as such in many Windows user frontends (GUIs), and most file-related APIs (Win32, CRT, .NET, whatever) don't distinguish between files and hard links (only specific Windows APIs - and tools which use them - let you query the true identity of hard links).
There is no reason to muse about different copy semantics, really.
Hard links is nothing an average user should ever touch (for basically the reasons you mentioned earlier). This is a feature meant for enterprise-scale customers, allowing them a comparatively easy way out of configuration and compatibility conundrums. And those IT departments usually know about the pitfalls of hard links and have their backup / synchronization procedures with their respective tool chains setup accordingly...
Again, wrong. That is exactly what the user expects.Sob wrote: If previously existing target is hardlink, it's overwritten and it changes also other linked files:Using TC, copy newfile.txt to hardlink.txt, confirm overwrite and then check content of testfile.txt - it also contains "new". This might be unexpected for user.Code: Select all
echo testfile > testfile.txt mklink /h hardlink.txt testfile.txt echo new > newfile.txt
If i alter your little batch script by writing to the hardlink.txt instead of newfile.txt:
echo testfile > testfile.txt
mklink /h hardlink.txt testfile.txt
echo new > hardlink.txt
then testfile.txt will also contain the "new" text. Hence, TC is doing exactly what is expected when 'overwriting' hardlink.txt.
First, everyone please forget that I wrote anything about hard links. I should have stayed with "I don't like them and don't care about them". :)
As for the bugs, different display for volume mount points is fixed, TC now prepends \??\. But TC now also incorrectly prepends \??\ to all junctions. They work, so it's again display issue only.
Original:
08.09.2013 20:44 <JUNCTION> dirjunction [F:\source\testdir]
Copy:
07.10.2013 14:03 <JUNCTION> dirjunction [\??\F:\source\testdir]
As for the bugs, different display for volume mount points is fixed, TC now prepends \??\. But TC now also incorrectly prepends \??\ to all junctions. They work, so it's again display issue only.
Original:
08.09.2013 20:44 <JUNCTION> dirjunction [F:\source\testdir]
Copy:
07.10.2013 14:03 <JUNCTION> dirjunction [\??\F:\source\testdir]
- ghisler(Author)
- Site Admin
- Posts: 50541
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
2Sob
Unfortunately this isn't currently available because I don't copy the "Comment" part.
Unfortunately this isn't currently available because I don't copy the "Comment" part.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Ok, I think it's safe to skip it, it's no real problem. Which makes all bugs fixed. Thank you.
Now there are some missing features. Is there any chance to persuade you about the following for 8.50?
Now there are some missing features. Is there any chance to persuade you about the following for 8.50?
- support for file symlinks (just symlinks, no hardlinks)
- link options in copy dialog (because it's like e.g. NTFS permissions, sometimes it's needed and sometimes not and global ini switch is not the best way)