How to efficiently assign color to symbolic links?

English support forum

Moderators: Hacker, petermad, Stefan2, white

KevinMo
Member
Member
Posts: 104
Joined: 2005-03-27, 01:37 UTC

How to efficiently assign color to symbolic links?

Post by *KevinMo »

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
Last edited by KevinMo on 2014-01-30, 08:08 UTC, edited 1 time in total.
meisl
Member
Member
Posts: 171
Joined: 2013-12-17, 15:30 UTC

Post by *meisl »

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"?
KevinMo
Member
Member
Posts: 104
Joined: 2005-03-27, 01:37 UTC

Post by *KevinMo »

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
meisl
Member
Member
Posts: 171
Joined: 2013-12-17, 15:30 UTC

Post by *meisl »

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)
User avatar
milo1012
Power Member
Power Member
Posts: 1158
Joined: 2012-02-02, 19:23 UTC

Post by *milo1012 »

@meisl I'm pretty sure he has done the right thing for defining colors, he explained it clearly and it wouldn't work otherwise.
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
No. It's useless to set "current dir only".
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.
meisl
Member
Member
Posts: 171
Joined: 2013-12-17, 15:30 UTC

Post by *meisl »

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?
KevinMo
Member
Member
Posts: 104
Joined: 2005-03-27, 01:37 UTC

Post by *KevinMo »

@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.
Edit
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.
User avatar
petermad
Power Member
Power Member
Posts: 16118
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

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
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
KevinMo
Member
Member
Posts: 104
Joined: 2005-03-27, 01:37 UTC

Post by *KevinMo »

My system was TC 8.01 and windows 7 on both sides.

The difference was clearly noticable in my case. With the "file type = reparse point" rule in effect, the item pops up one by one from top to the bottom in slow cases.

May I ask if your test environment on a pretty fast LAN ?
User avatar
petermad
Power Member
Power Member
Posts: 16118
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

2KevinMo
May I ask if your test environment on a pretty fast LAN
No, it is on a Microsoft home network with 4 computers.
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
KevinMo
Member
Member
Posts: 104
Joined: 2005-03-27, 01:37 UTC

Post by *KevinMo »

Oh, this is embarrassing :oops: I was testing on a wrong folder.

@petermad
You are correct that the reverse match does not improve the speed.

I edited the previous post. This thread is still open to solutions or workarounds.

Best regards
meisl
Member
Member
Posts: 171
Joined: 2013-12-17, 15:30 UTC

Post by *meisl »

So, doesn't this look like a bug in 8.01 that's been fixed in 8.5?

KevinMo, it would really help if you tested with 8.5 RC2. You do not need to switch completely to it, just install in a new dir "totalcmd85RC2" for example.
KevinMo
Member
Member
Posts: 104
Joined: 2005-03-27, 01:37 UTC

Post by *KevinMo »

@meisl
Unfortunately it doesn't seem to be a bug in 8.01.
I just tried 8.5RC2 with a fresh install, and there's no notable difference.
meisl
Member
Member
Posts: 171
Joined: 2013-12-17, 15:30 UTC

Post by *meisl »

Oh, too bad!
So the question remains what it is that makes it slow for you but not for petermad.
I, for one, don't have a clue...
KevinMo
Member
Member
Posts: 104
Joined: 2005-03-27, 01:37 UTC

Post by *KevinMo »

I'm afraid I think petermad is on a faster network. Mine is a intranet through VPN across ISPs.
Thanks for your help :)
Post Reply