How-to Copy symbolic links itself, not the content?

English support forum

Moderators: white, Hacker, petermad, Stefan2

Fla$her
Power Member
Power Member
Posts: 2328
Joined: 2020-01-18, 04:03 UTC

Re: How-to Copy symbolic links itself, not the content?

Post by *Fla$her »

Fla$her wrote: 2022-10-08, 00:59 UTCHere we need a loop with the utility ln.exe. I can help with that later.
Actually, it's simple. Take ln.
%COMMANDER_PATH%\Filelists\SymlinksToFolders.txt (UTF-8 no BOM) with full paths (real path|link path):
D:\marvel\mcu\infinity saga\phase 1\1-iron man|D:\marvel\films\iron man
D:\marvel\mcu\infinity saga\phase 1\4-iron man 2|D:\marvel\films\iron man 2
D:\marvel\mcu\infinity saga\phase 1\3-thor|D:\marvel\films\thor
D:\marvel\mcu\infinity saga\phase 3\2-wanda vision|D:\marvel\tv\wanda vision
Command: %ComSpec% /q/c >nul chcp 65001|for /f "usebackq tokens=1,2 delims=|" %d in ("%COMMANDER_PATH%\Filelists\SymlinksToFolders.txt") do "%COMMANDER_PATH%\Utils\ln\ln64.exe" --symbolic "%%d" "%%e"

P. S.: In fact, this task is done outside TC and in other forums.
Overquoting is evil! 👎
rahreg
Junior Member
Junior Member
Posts: 8
Joined: 2022-10-04, 19:32 UTC

Re: How-to Copy symbolic links itself, not the content?

Post by *rahreg »

Since CopyLinks=2 didn't work like the help suggests I figured I would manually create the links on the target with a batch file. But now I don't want the links to be copied at all to the target, especially as directories with the contents in them. So I changed CopyLinks to 0 and added IgnoreLinks=1, but it's STILL copying the links as directories with the contents in them. So it is not ignoring the links at all.

Do I need to do something else or something special to get it to ignore the links?

TIA
rahreg
User avatar
Usher
Power Member
Power Member
Posts: 1675
Joined: 2011-03-11, 10:11 UTC

Re: How-to Copy symbolic links itself, not the content?

Post by *Usher »

rahreg wrote: 2022-10-11, 15:14 UTC added IgnoreLinks=1
Have you tried IgnoreLinks=17 or other values?
Andrzej P. Wozniak
Polish subforum moderator
rahreg
Junior Member
Junior Member
Posts: 8
Joined: 2022-10-04, 19:32 UTC

Re: How-to Copy symbolic links itself, not the content?

Post by *rahreg »

Hi Usher. I just tried 17 and no change. Still getting directories with the contents.

Thanks for trying. Any other suggestions?
User avatar
Dalai
Power Member
Power Member
Posts: 9404
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: How-to Copy symbolic links itself, not the content?

Post by *Dalai »

2rahreg
Did you put the IgnoreLinks key in the correct section [Configuration], in the correct wincmd.ini (see TC's help > About dialog), and is that key present only once? Did you restart TC after adding/changing the key value?

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
rahreg
Junior Member
Junior Member
Posts: 8
Joined: 2022-10-04, 19:32 UTC

Re: How-to Copy symbolic links itself, not the content?

Post by *rahreg »

Dalai,

THANK YOU. It turns out I was doing it in the wrong ini file. I did all the other things you asked about though.

I just tried it and it still copied the links as directories but did not copy the contents. So that's progress.

I was able to get it to not copy both the links and the contents using robocopy with the /s /xj options. I would like to do it in TC but I guess this is better than nothing.

Thanks again.
rahreg
rahreg
Junior Member
Junior Member
Posts: 8
Joined: 2022-10-04, 19:32 UTC

Re: How-to Copy symbolic links itself, not the content?

Post by *rahreg »

Fla$her wrote: 2022-10-09, 11:48 UTC
Fla$her wrote: 2022-10-08, 00:59 UTCHere we need a loop with the utility ln.exe. I can help with that later.
Actually, it's simple. Take ln.
%COMMANDER_PATH%\Filelists\SymlinksToFolders.txt (UTF-8 no BOM) with full paths (real path|link path):
D:\marvel\mcu\infinity saga\phase 1\1-iron man|D:\marvel\films\iron man
D:\marvel\mcu\infinity saga\phase 1\4-iron man 2|D:\marvel\films\iron man 2
D:\marvel\mcu\infinity saga\phase 1\3-thor|D:\marvel\films\thor
D:\marvel\mcu\infinity saga\phase 3\2-wanda vision|D:\marvel\tv\wanda vision
Command: %ComSpec% /q/c >nul chcp 65001|for /f "usebackq tokens=1,2 delims=|" %d in ("%COMMANDER_PATH%\Filelists\SymlinksToFolders.txt") do "%COMMANDER_PATH%\Utils\ln\ln64.exe" --symbolic "%%d" "%%e"

P. S.: In fact, this task is done outside TC and in other forums.
Hi Fla$her,

Sorry, this post was on page 2 and I didn't notice there was a page 2 until after posting my other messages today.

I took a look at ln and that does look like it will do what I want with the --copy option. But I'm not sure what to do with what you sent.

Am I supposed to manually define the paths in the SymlinksToFolders.txt file?

What am I supposed to do with the command code you provided?

Is this for creating the links of for copying them?

I already have TC setup to create links using commands I added to the TC menu. I got that from the Extended English Menus for Total Commander 10.50 32bit and 64bit under Windows 7 64bit (by petermad) plugin -- tc1050_win7x86_amd64_eng.zip. That's actually how I created the links in my example.

But thanks for pointing me to ln, I will play with that.

rahreg
Post Reply