How to efficiently assign color to symbolic links?
Moderators: Hacker, petermad, Stefan2, white
How to efficiently assign color to symbolic links?
Hi
I'm trying to highlight symbolic links (a.k.a reparse points, not shortcuts) in the directory list.
The only way I found to define color for symbolic links is using "search in plugins" where I specify tc > file type = reparse point. This works correctly, but significantly slows down browsing of network folders.
I noticed that in the size column, TC actually detects symbolic link immediately. I wonder if there's anyway to assign color utilizing that, but I couldn't get it to work.
Is there any way to achieve this efficiently?
Thanks in advance.
Best regards,
Mo
I'm trying to highlight symbolic links (a.k.a reparse points, not shortcuts) in the directory list.
The only way I found to define color for symbolic links is using "search in plugins" where I specify tc > file type = reparse point. This works correctly, but significantly slows down browsing of network folders.
I noticed that in the size column, TC actually detects symbolic link immediately. I wonder if there's anyway to assign color utilizing that, but I couldn't get it to work.
Is there any way to achieve this efficiently?
Thanks in advance.
Best regards,
Mo
Last edited by KevinMo on 2014-01-30, 08:08 UTC, edited 1 time in total.
Over here (on XP, still...) I'm getting a different icon for symbolic links (additionally to "<LNK>" vs "<DIR>" in the size column), different from normal folders and also from Windows shortcuts, for that matter.
But I guess that's what you're seeing too, and you want them to stand out even more, and independent of any selection. Right?
EDIT: to ask more clearly: does it have to be color or is it rather about having them "really stand out"?
But I guess that's what you're seeing too, and you want them to stand out even more, and independent of any selection. Right?
EDIT: to ask more clearly: does it have to be color or is it rather about having them "really stand out"?
That's a nice tip! Thank you very much. I don't show icons in my TC typically (see screenshot below).
You are exactly correct that I just need them to be "really stand out". But personally I still would prefer color highlight instead of icon (as in the screenshot below). It also looks more like what I used to see in linux. But thanks again for the tip on icons, at least that's a much better solution than using the "file type"
The most annoying part is that since the size column knows it, I think this should be possible, but I just can't figure out how. As shown in the screenshot, it seems I can only set a rule on "size" to compare with a number.
Image: https://www.dropbox.com/s/qldgskwsp90q0gq/TcSymlinkPost.PNG
You are exactly correct that I just need them to be "really stand out". But personally I still would prefer color highlight instead of icon (as in the screenshot below). It also looks more like what I used to see in linux. But thanks again for the tip on icons, at least that's a much better solution than using the "file type"

The most annoying part is that since the size column knows it, I think this should be possible, but I just can't figure out how. As shown in the screenshot, it seems I can only set a rule on "size" to compare with a number.
Image: https://www.dropbox.com/s/qldgskwsp90q0gq/TcSymlinkPost.PNG
Hmm, just to make sure: you are going to
Configuration | Options | Display/Color | "Define colors by file type..." | "Add..." | "Define..."
and that's the dialog from your screenshot?
You know, it's called "Define selection" in that context, not "Find Files" (which makes sense). But maybe you opened Find Files just for the screenshot.
Anyways, tc.file type = reparse point is the thing to do, you cannot use size for it. It's just a matter of displaying *something* in the size column for folders and symlinks, not an actual size you can query.
However, you're right that it should take virtually no time to determine the file type, even on network drives.
I don't have network drives here atm so I didn't try this, only with local LNKs - which are fast. But it really shouldn't matter.
Which version of TC do you use? Maybe try 8.5 RC2.
The last thing I can think of is to try to narrow the selection filter further:
on "General" tab disable "Search archives" and set "Search in subdirectories" to "current dir only"
on "Advanced" tab check "Attributes" | "Directory" and nothing else
(don't forget to save it)
Configuration | Options | Display/Color | "Define colors by file type..." | "Add..." | "Define..."
and that's the dialog from your screenshot?
You know, it's called "Define selection" in that context, not "Find Files" (which makes sense). But maybe you opened Find Files just for the screenshot.
Anyways, tc.file type = reparse point is the thing to do, you cannot use size for it. It's just a matter of displaying *something* in the size column for folders and symlinks, not an actual size you can query.
However, you're right that it should take virtually no time to determine the file type, even on network drives.
I don't have network drives here atm so I didn't try this, only with local LNKs - which are fast. But it really shouldn't matter.
Which version of TC do you use? Maybe try 8.5 RC2.
The last thing I can think of is to try to narrow the selection filter further:
on "General" tab disable "Search archives" and set "Search in subdirectories" to "current dir only"
on "Advanced" tab check "Attributes" | "Directory" and nothing else
(don't forget to save it)
@meisl I'm pretty sure he has done the right thing for defining colors, he explained it clearly and it wouldn't work otherwise.
TC is just using the "Search for" field and pretty much ignores what these options and "search in" say, it searches only the current dir for the color function anyway.
Btw, Symlinks are not limited to dirs/folers, also files can have these!
@KevinMo Are you sure that the color search is the definite cause for this?
I mean when switching it off things go faster for network files?
Network is in general much slower when it comes to getting file attributes.
Since we don't know how these things work internally you could try to avoid the direct search for SymLinks and search for all things that are not Dirs and Files:
plugins tab:
tc - file type != file
tc - file type != folder
(combine both with "AND(all match)")
Give it a try.
No. It's useless to set "current dir only".meisl wrote:The last thing I can think of is to try to narrow the selection filter further:
on "General" tab disable "Search archives" and set "Search in subdirectories" to "current dir only"
on "Advanced" tab check "Attributes" | "Directory" and nothing else
TC is just using the "Search for" field and pretty much ignores what these options and "search in" say, it searches only the current dir for the color function anyway.
Btw, Symlinks are not limited to dirs/folers, also files can have these!
@KevinMo Are you sure that the color search is the definite cause for this?
I mean when switching it off things go faster for network files?
Network is in general much slower when it comes to getting file attributes.
Since we don't know how these things work internally you could try to avoid the direct search for SymLinks and search for all things that are not Dirs and Files:
plugins tab:
tc - file type != file
tc - file type != folder
(combine both with "AND(all match)")
Give it a try.
Yea milo1012, I agree. Just to make sure, you never know...
This also applies to my "narrowed-search" proposal. I share your assumptions about how TC uses them in that context, but maybe there's a hidden bug?
Your "reversed-logic" suggestion is great! @KevinMo: plz check and report if it makes a difference!
Re "symlinks": again you're right, milo1012. In fact it's a bit sloppy to use the term as such in WinWorld. -> http://en.wikipedia.org/wiki/Symbolic_link
I was assuming that we're talking about "reparse points" aka "junction points" aka "junctions" only.
@KevinMo: are we
Since there's only three values that the internal tc.file type offers - file, folder and reparse point - can TC distinguish between the other types of links?
This also applies to my "narrowed-search" proposal. I share your assumptions about how TC uses them in that context, but maybe there's a hidden bug?
Your "reversed-logic" suggestion is great! @KevinMo: plz check and report if it makes a difference!
Re "symlinks": again you're right, milo1012. In fact it's a bit sloppy to use the term as such in WinWorld. -> http://en.wikipedia.org/wiki/Symbolic_link
I was assuming that we're talking about "reparse points" aka "junction points" aka "junctions" only.
@KevinMo: are we

Since there's only three values that the internal tc.file type offers - file, folder and reparse point - can TC distinguish between the other types of links?
Edit@milo1012
Bravos! You saved my day!
Your reverse matching methods worked. That was genius.
I'm sure it was the reparse point rule slowed it down because it's fast if I delete the rule or simply move it to lower priority.
Unfortunately the reverse matching methods did not work. It is at least as slow as using "= reparse points".
Sorry about the confusion. I tested on a wrong folder.
@meisl
Yes. I was using "Define selection". Please excuse my sloppiness on the terminology here

I'm using TC 8.01, but I don't think TC 8.5RC2 will make a difference.
I use "mklink /d" command to make these links. You are correct that links on windows is not as nice as on linux. I'm using it for two reasons:
1. Thanks to TC that the sync tool now works with symbolic links. I can sync a set of network folders to local machine in one clean directory.
2. I need to access these network folders regularly. I found put their symbolic link in one folder is easiest for me, alternatives are mapped network drives, TC hotlist, TC locked tabs which all seems less convenient.
I think TC could be written to handle that efficiently. I'll post in the suggestion forum referencing this thread.
Thank you very much again for your reply, guys.
Best regards,
Mo
Last edited by KevinMo on 2014-01-31, 07:21 UTC, edited 1 time in total.
I just tried both methods with an otherwise clean ini file - it seems to me that the "tc > file type = reparse point" is faster that the combined method "tc > file type != file" + "tc > file type = folder".
This is when testet with Win XP - with Win7 of Win 8.1 it is much faster and not possible to distinguish a difference in speed.
When I have many color filters enabled, I notice a little slowdown with 32bit TC when browsing dirs on Windows XP netshare (mshome), but much less when browsing dirs on Win 7/8 netshares (workgroup). 64bit TC seems faster with the same colorfilters than 32bit TC
This is when testet with Win XP - with Win7 of Win 8.1 it is much faster and not possible to distinguish a difference in speed.
When I have many color filters enabled, I notice a little slowdown with 32bit TC when browsing dirs on Windows XP netshare (mshome), but much less when browsing dirs on Win 7/8 netshares (workgroup). 64bit TC seems faster with the same colorfilters than 32bit TC
License #524 (1994)
Danish Total Commander Translator
TC 11.55rc4 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1393a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish Total Commander Translator
TC 11.55rc4 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1393a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
2KevinMo
No, it is on a Microsoft home network with 4 computers.May I ask if your test environment on a pretty fast LAN
License #524 (1994)
Danish Total Commander Translator
TC 11.55rc4 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1393a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish Total Commander Translator
TC 11.55rc4 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1393a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar