Does CopyLinks=1 work with folder junctions?

English support forum

Moderators: Hacker, petermad, Stefan2, white

knn
Junior Member
Junior Member
Posts: 11
Joined: 2021-10-27, 23:51 UTC

Does CopyLinks=1 work with folder junctions?

Post by *knn »

I want to copy a directory junction <LNK> as junction, i.e. not the contents, just the junction.

I have set

Code: Select all

CopyLinks=1
in wincmd.ini but Total Commander still copies all of the contents instead of merely creating a junction.

I can confirm that I am editing the correct wincmd.ini (Help-->About), I can confirm that there's only 1

Code: Select all

[Configuration] section
and I can confirm that there's only 1 line with

Code: Select all

CopyLinks=
The copy mode is Standard Copy Method.
I have tried to copy the junction directly (= standing with the cursor on it) or copy the folder where the junction is located. Both times the contents get copied instead of just the junction.

What am I doing wrong?

Also: When I press SPACE when standing on a Junction, no occupied space gets calculated.

I am using TC (x64) 10.52, Win7, wincmd.ini is in a location specified by "/i=". The target of the junction exists, i.e. the junction folder can be entered.
User avatar
sqa_wizard
Power Member
Power Member
Posts: 3893
Joined: 2003-02-06, 11:41 UTC
Location: Germany

Re: Does CopyLinks=1 work with folder junctions?

Post by *sqa_wizard »

Well, CopyLinks=1 will indeed copy a junction only (with unchanged target address)
Note: you can copy a junction to a ntfs formatted target only (e.g. FAT formatted target will not work)
#5767 Personal license
knn
Junior Member
Junior Member
Posts: 11
Joined: 2021-10-27, 23:51 UTC

Re: Does CopyLinks=1 work with folder junctions?

Post by *knn »

This is a junction on an NTFS HDD to be copied onto another NTFS HDD.
User avatar
petermad
Power Member
Power Member
Posts: 16032
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Does CopyLinks=1 work with folder junctions?

Post by *petermad »

2knn
CopyLinks=1 works as expected here.

Can you create a junction on the target drive?
Last edited by petermad on 2023-06-19, 19:25 UTC, edited 1 time in total.
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
knn
Junior Member
Junior Member
Posts: 11
Joined: 2021-10-27, 23:51 UTC

Re: Does CopyLinks=1 work with folder junctions?

Post by *knn »

petermad wrote: 2023-06-19, 19:04 UTCCopyLinks=1 works as ecpected here.
How so? It does not recreate the junction. It simply copies all of the content and creates a normal folder as I would expect from CopyLinks=0, not from CopyLinks=1
petermad wrote: 2023-06-19, 19:04 UTCCan you create a junction on the target drive?
Sure, any I like.
User avatar
petermad
Power Member
Power Member
Posts: 16032
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Does CopyLinks=1 work with folder junctions?

Post by *petermad »

How so? It does not recreate the junction
But here it does, if CopyLinks=1 and the target is NTFS formatted. See: https://tcmd.madsenworld.dk/copylinks.mp4

Sorry for asking this - you do remember to restart TC after you make manual changes to wincmd.ini ?
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
knn
Junior Member
Junior Member
Posts: 11
Joined: 2021-10-27, 23:51 UTC

Re: Does CopyLinks=1 work with folder junctions?

Post by *knn »

petermad wrote: 2023-06-19, 19:28 UTCBut here it does
But not on my HDD. The same action you show in your video produces a folder, not a link. BTW, DoubleCommander behaves correctly and produces a link.
petermad wrote: 2023-06-19, 19:28 UTCSorry for asking this - you do remember to restart TC after you make manual changes to wincmd.ini ?
Yes, I closed every instance of TC and restarted. However, I doubt that that was needed since I didn't change the wincmd.ini anyway since it is and always was "CopyLinks=1"

Probably important: TC behaves correctly (= produces a link) when copying to/on another HDD. The only difference between the HDDs is the size and cluster size (3TB 4k works, 18TB 8k doesn't).

3TB -> 3TB copy/move junction works
18TB -> 3TB copy/move junction works
3TB -> 18TB copy/move junction fails (= produces folder)
18TB -> 18TB copy junction fails (= produces folder), move junction works (keeps it as junction)
Last edited by knn on 2023-06-19, 21:35 UTC, edited 1 time in total.
User avatar
petermad
Power Member
Power Member
Posts: 16032
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Does CopyLinks=1 work with folder junctions?

Post by *petermad »

TC behaves correctly (= produces a link) when copying on another HDD. The only difference between the HDDs is the size and cluster size (3TB 4k works, 18TB 8k doesn't).
Here I have tested on the same partition and on two different NFTS partitions of the same HDD (1 TB), and on a 4TB USB harddisk, all with 4K clusters.
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
JackV
Junior Member
Junior Member
Posts: 3
Joined: 2023-06-28, 17:04 UTC

Re: Does CopyLinks=1 work with folder junctions?

Post by *JackV »

I installed the trial version of TC to test the synchronization feature that I want to use to back up some volumes.
The source and destination volumes are both NTSF formatted and I placed the CopyLinks=1 parameter into the wincmd.ini file.

Situation:
I want to back up volume A to volume C and volume B to volume D.
Volume B contains two directory symbolic links <LNK>, both pointing to directories on volume A.

If I copy both symlinks (<LNK>) from left to right with F5 then the symlinks are correctly copied as symlink.
However, when I use the Synchronize Dirs... command, each symlink is copied as a directory with its contents and not as a symlink.

In the given situation, the two directories with its contents on A are copied twice: when syncing from A to C, the directories with its contents are copied to C, and when syncing from B to D, the directories on A with its contents are also copied to D.

HOWEVER..........:
When I later tried to copy the symlink once more using F5, the <LNK> was replaced by the size of the directory's contents as soon as I pressed F5. When having selected the symlink with the mouse and pressing the space bar several times before using F5, the <LNK> remained <LNK>.
Even after restarting TC several times, I was no longer able to copy the symlink as a symlink ?????????

JackV
User avatar
petermad
Power Member
Power Member
Posts: 16032
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Does CopyLinks=1 work with folder junctions?

Post by *petermad »

However, when I use the Synchronize Dirs... command, each symlink is copied as a directory with its contents and not as a symlink.
What happens if you set SyncIgnoreJunctions=1
Help wrote:SyncIgnoreJunctions=0 0: Also follow junctions (reparse points) to directories when synchronizing
1: Exclude directory junctions from synchronizing
Warning: If a directory with the same name exists on the second side, files in it seem to exist only on that side because the junction on the first side is excluded!
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
JackV
Junior Member
Junior Member
Posts: 3
Joined: 2023-06-28, 17:04 UTC

Re: Does CopyLinks=1 work with folder junctions?

Post by *JackV »

What happens if you set SyncIgnoreJunctions=1
When I use the function Synchronize Dirs... and also when I use F5:
With the setting SyncIgnoreJunctions=1 the symlink is ignored (not copied).
With the setting SyncIgnoreJunctions=0 the symlink is copied as directory with its contents and not as symlink.

Conclusion: this parameter has no influence on the way TC copies a symlink.

By the way, are you able to copy a symlink as a symlink with Synchronize Dirs as well as F5?
User avatar
petermad
Power Member
Power Member
Posts: 16032
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Does CopyLinks=1 work with folder junctions?

Post by *petermad »

By the way, are you able to copy a symlink as a symlink with Synchronize Dirs as well as F5?
With F5 I can copy symlink and junction directories as links (with CopyLinks=1).
I can NOT copy symlink and junction directories as links with Synchronize Directories.
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
JackV
Junior Member
Junior Member
Posts: 3
Joined: 2023-06-28, 17:04 UTC

Re: Does CopyLinks=1 work with folder junctions?

Post by *JackV »

Thanks for your quick response.
I can NOT copy symlink and junction directories as links with Synchronize Directories.
That's a pity, because it's precisely this Synchronize Dirs function that I wanted to use to make backups.

Unfortunately, in the next version 11 newsletter, there is no indication that this feature has been added in Synchronize Dirs.
Maybe an idea for the developers of TC to still implement this function in version 11.
konfekt
Junior Member
Junior Member
Posts: 13
Joined: 2021-11-16, 09:26 UTC

Re: Does CopyLinks=1 work with folder junctions?

Post by *konfekt »

A similar discovery lead to the thread viewtopic.php?t=50524 with the workaround of using Fastcopy instead of Total Commander's copy function.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50532
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Does CopyLinks=1 work with folder junctions?

Post by *ghisler(Author) »

How should this work? Symlinks can point anywhere, the target can be part of the synchronized directories, be outside of them, or even on a different drive. You can't just copy it, e.g. because the symlink on the left may be pointing to c:\target while the one on the right is pointing to d:\target.
Author of Total Commander
https://www.ghisler.com
Post Reply