copy symlinks as symlinks
Moderators: Hacker, petermad, Stefan2, white
Re: copy symlinks as symlinks
Indeed hardlink and symbolic files are different type of link. TC already detect if a file is a link type or not (can see in TC's default size column, a symbolic file is showing a <LNK>. edit:It also has the tc.file type column.. So the detection functions seems to be already there.)
This is also why i do not understand why the feature to also copy/move/sync symbolic files as symbolic or normal(as now) or ignore is not added yet to TC :s
For hardlink files, it does not seems to matter. Copying a hardlinked file into a normal type is no problem, unless user is trying to backup his OS manually on some backup folder and will use it to restore the system...
edit2: btw, i wrote a table that showing the current status of TC regarding the link types. See the picture linked from this topic: https://www.ghisler.ch/board/viewtopic.php?f=3&t=56956
This is also why i do not understand why the feature to also copy/move/sync symbolic files as symbolic or normal(as now) or ignore is not added yet to TC :s
For hardlink files, it does not seems to matter. Copying a hardlinked file into a normal type is no problem, unless user is trying to backup his OS manually on some backup folder and will use it to restore the system...
edit2: btw, i wrote a table that showing the current status of TC regarding the link types. See the picture linked from this topic: https://www.ghisler.ch/board/viewtopic.php?f=3&t=56956
Re: copy symlinks as symlinks
Counterintuitively, directory junctions are not the same as directory symlinks. IIRC, the behavior difference is mainly in how they are interpreted from an external machine. See e.g. https://superuser.com/questions/343074/directory-junction-vs-directory-symbolic-linkumbra wrote: 2019-12-24, 12:24 UTC You cannot tell a difference between the original and newly created hardlinks to a file. But it is easy to detect a symlink to a file. Just like it is easy to detect a symlink to a folder (AKA directory junction, in Microsoft nomenclature).
Re: copy symlinks as symlinks
So 11 years later is there yet an option to copy file LINKS as LINKS and not as the file the LINK points to?
If not, how do you guys copy file LINKS?
If not, how do you guys copy file LINKS?
Hoecker sie sind raus!
Re: copy symlinks as symlinks
2Sir_SiLvA
What type of links to files are you referring to? Hard link or symlink? For the former, please see Ghisler's answer on page 1 of this thread; they're (almost) indistinguishable from regular files, and hard links only work within the same volume.
If you're referring to the latter, please keep in mind that creating symlinks requires administrative privileges, regardless of where they point to and how they're created.
So, if talking about links, please specify the type of link as this is important.
What type of links to files are you referring to? Hard link or symlink? For the former, please see Ghisler's answer on page 1 of this thread; they're (almost) indistinguishable from regular files, and hard links only work within the same volume.
If you're referring to the latter, please keep in mind that creating symlinks requires administrative privileges, regardless of where they point to and how they're created.
So, if talking about links, please specify the type of link as this is important.
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Re: copy symlinks as symlinks
2Dalai
In %Commander_Drive%\aktuelle Projekte\Total Commander\01 - TCUpdater - Tool to Update TC from Installpackage\Version 1.1\tcupdater.exe
I have a tool I wrote myself and in the "file" in %Commander_Path%\Tools\SmallTools\own\tcupdater.exe
is a link created with mklink to the first file.
In the filelist under filesize the "file" shows up as <LINK> so there is a way to differntiate between the file and the link
but when I copy that link with F5 the file is copied instead of the link.
(PS: the link has the attribute faSymLink (Delphi) if that helps)
In %Commander_Drive%\aktuelle Projekte\Total Commander\01 - TCUpdater - Tool to Update TC from Installpackage\Version 1.1\tcupdater.exe
I have a tool I wrote myself and in the "file" in %Commander_Path%\Tools\SmallTools\own\tcupdater.exe
is a link created with mklink to the first file.
In the filelist under filesize the "file" shows up as <LINK> so there is a way to differntiate between the file and the link
but when I copy that link with F5 the file is copied instead of the link.
(PS: the link has the attribute faSymLink (Delphi) if that helps)
Hoecker sie sind raus!
Re: copy symlinks as symlinks
OK, so you're referring to symlinks pointing to files in this case.
Since you asked about how to copy links, here's my answer to that. The implementation in TC is pretty much useless, IMO. It requires the user to change/set CopyLinks setting, copy the files, and change the CopyLinks setting back to its previous value. Who does that? And if I understand it correctly, CopyLinks doesn't even handle symlinks.
Unfortunately, various people - including me - were not successful in convincing Ghisler to add an option to the copy dialog that tells TC how links are to be handled. This needs to be decided on a case-by-case basis.
So, here's what I've been doing:
I copy the files and skip all links; the IgnoreLinks setting can be used for that. Then I search for files and directories that are links (junctions or hard links, I don't use symlinks at all), export them into a text file and recreate them in the target directory structure. Yes, this is quite a lot of work. But it could be automated with a script that reads links and what they're pointing to. And I have such script for directories in %UserProfile% (especially in %AppData%) which point to my data drive.
Since you asked about how to copy links, here's my answer to that. The implementation in TC is pretty much useless, IMO. It requires the user to change/set CopyLinks setting, copy the files, and change the CopyLinks setting back to its previous value. Who does that? And if I understand it correctly, CopyLinks doesn't even handle symlinks.
Unfortunately, various people - including me - were not successful in convincing Ghisler to add an option to the copy dialog that tells TC how links are to be handled. This needs to be decided on a case-by-case basis.
So, here's what I've been doing:
I copy the files and skip all links; the IgnoreLinks setting can be used for that. Then I search for files and directories that are links (junctions or hard links, I don't use symlinks at all), export them into a text file and recreate them in the target directory structure. Yes, this is quite a lot of work. But it could be automated with a script that reads links and what they're pointing to. And I have such script for directories in %UserProfile% (especially in %AppData%) which point to my data drive.
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Re: copy symlinks as symlinks
2Sir_SiLvA
Maybe this post will help?
Is it possible to copy file symlinks as links? (Horst.Epp)
Solution with the “Fastcopy” tool (Size: <LNK>).
Example
C:\Everything\Everything_DRIVE-C\
copied to...
D:\TEMP\
Maybe this post will help?
Is it possible to copy file symlinks as links? (Horst.Epp)
Solution with the “Fastcopy” tool (Size: <LNK>).
BUTTON - Copy folders or files using FastCopy (as ADMIN) - <LNK> Symlinks
Code: Select all
TOTALCMD#BAR#DATA
*%COMMANDER_PATH%\Tools\FastCopy\FastCopy.exe
/cmd=update /balloon=FALSE /log=FALSE /auto_close /srcfile_w="%WL" /to="%T"
C:\WINDOWS\System32\shell32.dll,264
Copy folders or files using FastCopy (as ADMIN) || <LNK> Symlinks|https://www.ghisler.ch/board/viewtopic.php?p=429496#p429496|Is it possible to copy file symlinks as links? (Horst.Epp)
-1
C:\Everything\Everything_DRIVE-C\
Code: Select all
Name Ext Size Date Attr
Filters-DRIVE-C csv <LNK> 02.02.2023 15:48 -a--
D:\TEMP\
Code: Select all
Name Ext Size Date Attr
Filters-DRIVE-C csv <LNK> 02.02.2023 15:48 -a--
Re: copy symlinks as symlinks
If there is at least some kind of solution - even with the use of third-party programs, this is great!
BUT so far, the main problem is the fact that it has already been voiced above - since Total itself
(as the user would like) does not correctly process such "connections" - then there is a problem
with finding them among the massive of selected files|folders|subfolders.....
In order to then accurately process only them.
OR we need to put the use of such third-party programs on a permanent basis instead of
using the standard copy/move functions that are built into the Total.
So as not to think that some files/links were not processed during the copy/moving process.
BUT so far, the main problem is the fact that it has already been voiced above - since Total itself
(as the user would like) does not correctly process such "connections" - then there is a problem
with finding them among the massive of selected files|folders|subfolders.....
In order to then accurately process only them.
OR we need to put the use of such third-party programs on a permanent basis instead of
using the standard copy/move functions that are built into the Total.
So as not to think that some files/links were not processed during the copy/moving process.
#146217 personal license
Re: copy symlinks as symlinks
Yes, It's possible with FastCopy.tuska wrote: 2025-03-26, 18:16 UTC 2Sir_SiLvA
Maybe this post will help?
Is it possible to copy file symlinks as links? (Horst.Epp)
Solution with the “Fastcopy” tool (Size: <LNK>).
My parameters for the copy button are
/cmd=Update /balloon=FALSE /log /filelog /auto_close /srcfile_w="%WL" /to="%T"
You have to set the FastCopy options under
Main Settings / Copy Options
x Copy Junction/Symlink as Junction/Symlink
TC must run with enhanced rights for this.
Windows 11 Home, Version 24H2 (OS Build 26100.3915)
TC 11.51 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.2.1 x64
TC 11.51 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.2.1 x64
Re: copy symlinks as symlinks
100% agree on this!AntonyD wrote: 2025-03-26, 21:11 UTC If there is at least some kind of solution - even with the use of third-party programs, this is great!
BUT so far, the main problem is the fact that it has already been voiced above - since Total itself
(as the user would like) does not correctly process such "connections" - then there is a problem
with finding them among the massive of selected files|folders|subfolders.....
In order to then accurately process only them.
OR we need to put the use of such third-party programs on a permanent basis instead of
using the standard copy/move functions that are built into the Total.
So as not to think that some files/links were not processed during the copy/moving process.
2Horst.Epp
Thanks for your input, which helps a lot!
Is FastCopy portable?
Hoecker sie sind raus!
Re: copy symlinks as symlinks
YesSir_SiLvA wrote: 2025-03-27, 17:29 UTC 2Horst.Epp
Thanks for your input, which helps a lot!
Is FastCopy portable?
I use a batch like this to update it inplace.
FastCopy5.7.15_installer.exe /noprog /nodesk /noapp /extract64 /nosubdir /dir=C:\tools\FastCopy
Windows 11 Home, Version 24H2 (OS Build 26100.3915)
TC 11.51 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.2.1 x64
TC 11.51 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.2.1 x64