+Problems with CopyLinks option

Bug reports will be moved here when the described bug has been fixed

Moderators: Hacker, petermad, Stefan2, white

User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50541
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Currently if there is a hard link, it will be skipped.
Author of Total Commander
https://www.ghisler.com
Sob
Power Member
Power Member
Posts: 945
Joined: 2005-01-19, 17:33 UTC

Post by *Sob »

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:

Code: Select all

echo testfile > testfile.txt
mklink /h hardlink.txt testfile.txt
echo new > newfile.txt
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.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50541
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

This is only about folder links, not file links.
Author of Total Commander
https://www.ghisler.com
gdpr deleted 6
Power Member
Power Member
Posts: 872
Joined: 2013-09-04, 14:07 UTC

Post by *gdpr deleted 6 »

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.
You got either the wrong understanding of the "copy" semantics with respect to the Windows OS, or you confuse hard links with directory junctions.

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...

Sob wrote: 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
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.
Again, wrong. That is exactly what the user expects.
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.
Sob
Power Member
Power Member
Posts: 945
Joined: 2005-01-19, 17:33 UTC

Post by *Sob »

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]
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

It is really a question if prefix is required for print name. Sysinternals Junction and NTFSLinks use it, however I noticed that mklink doesn't.
Sob
Power Member
Power Member
Posts: 945
Joined: 2005-01-19, 17:33 UTC

Post by *Sob »

I don't think this is important, it's just that TC should probably keep it the same way as the source had it, if it isn't too hard.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50541
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

2Sob
Unfortunately this isn't currently available because I don't copy the "Comment" part.
Author of Total Commander
https://www.ghisler.com
Sob
Power Member
Power Member
Posts: 945
Joined: 2005-01-19, 17:33 UTC

Post by *Sob »

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?
  • 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)
Post Reply