Searching files does not handle space chars as documented

The behaviour described in the bug report is either by design, or would be far too complex/time-consuming to be changed

Moderators: white, Hacker, petermad, Stefan2

Post Reply
Pedro17
Junior Member
Junior Member
Posts: 3
Joined: 2018-03-04, 19:10 UTC

Searching files does not handle space chars as documented

Post by *Pedro17 »

Hi

The help for Search (aka Find Files) function says this:
Note: Names with spaces do not need to be put in double quotes, e.g. Letter to Mr. Smith.doc. Total Commander now looks for both the entire name and the name parts individually.

The problem is that the individual parts are not searched.
For example, if I search for:
[face=courier]____a b[/face]
TC finds all filenames containing "a b" as a substring, but nothing else. The help text suggests that it should also find all files that contain "a" and/or "b" in the filename.

Then I tried to circumvent it with this search term:
[face=courier]____"a" "b"[/face]
but it did not find any match. When I try to think of what kind of files this can match, my best guess would be it never matches anything.

The proper search term for finding filenames containing "a" and/or "b" currently is this:
[face=courier]____*a* *b*[/face]

I discovered this behavior in 8.51a, but found it also in the latest version 9.12 (both x64). A major consequence of this behavior is that without using wildcards (*,?) or dot (.), it is not possible to search multiple patterns (masks).

Thanks
Pedro
I am a software engineer. I have no flaws, I have features.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

This is only true for the case when you enter a dot.
Author of Total Commander
https://www.ghisler.com
Pedro17
Junior Member
Junior Member
Posts: 3
Joined: 2018-03-04, 19:10 UTC

Post by *Pedro17 »

Hi Christian

Thanks for your answer. I reported this as I was in a wrong impression that the search behavior changed since my upgrade from older version (6.03a). But I tested with 6.03a now and it works exactly the same way. I understand the behavior now and it is OK with me as it allows me to search anything I want with proper usage of wildcards or dot, even though the help text is not very clear about *?. usage in combination with spaces.

One thing I still do not understand is this part of help text:
Total Commander now looks for both the entire name and the name parts individually.

Can you please give me an example when such dual search occurs?

Thanks
Pedro
I am a software engineer. I have no flaws, I have features.
Pedro17
Junior Member
Junior Member
Posts: 3
Joined: 2018-03-04, 19:10 UTC

Post by *Pedro17 »

I had some time to play with this again and found a case where TC will search entire string and its individual parts too. When I search for "a b.c", TC will find files a, b.c and "a b.c". Before, I incorrectly thought it searches those parts as substrings in filenames, because I missed this sentence from the help:
When the search string contains a dot, Total Commander will look for the exact name match.

Anyway, as I played with it, I discovered more oddities. When I have some more time, I'll make a post (maybe in a different forum area?) with all the logic rules I discover.

Pedro
I am a software engineer. I have no flaws, I have features.
Post Reply