[TC11.02] Inaccurate file search results

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
andry81
Junior Member
Junior Member
Posts: 97
Joined: 2018-11-22, 19:17 UTC

[TC11.02] Inaccurate file search results

Post by *andry81 »

If create these directories with files:
.../aaa/bbb.txt
.../aaa bbb/aaa bbb.txt
And open Fine Files dialog to search for the file `aaa bbb.txt` from a directory with these subdirectories.

The the results would be:
[.../aaa]
.../aaa bbb/aaa bbb.txt
.../aaa/bbb.txt
This looks like is not accurate result.

If use `"aaa bbb.txt"`, then the result is accurate as expected:
.../aaa bbb/aaa bbb.txt
If use the list of files: `aaa bbb.txt;bbb.txt`, then the result is even more strange:
[.../aaa]
.../aaa/bbb.txt
Is that by design?

Why not to put the check box ([x] Exact match) to the Find File dialog, which will automatically (re)quote the strings to guarantee the exact match?
User avatar
Dalai
Power Member
Power Member
Posts: 9393
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: [TC11.02] Inaccurate file search results

Post by *Dalai »

This is not a bug.

A space in the "Search for" field denotes a separation of different search terms - when it's not in quotes. In your example the input "aaa bbb.txt" (without quotes) searches for anything containing "aaa" as well as "bbb.txt" as an exact match (due to the dot). It's documented in TC help like this (highlight added by me):
Search for:
In this field, you can enter the search mask for the files you want to find. A question mark ? stands for exactly one character, and an asterisk * stands for any number of characters. Multiple search masks can be entered, separated by spaces (see examples below). All masks after the pipe character | will be treated as exclude masks.
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
andry81
Junior Member
Junior Member
Posts: 97
Joined: 2018-11-22, 19:17 UTC

Re: [TC11.02] Inaccurate file search results

Post by *andry81 »

2Dalai

This does not explain why the `aaa bbb.txt;bbb.txt` search is missed to find the `aaa bbb.txt` file.
User avatar
Dalai
Power Member
Power Member
Posts: 9393
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: [TC11.02] Inaccurate file search results

Post by *Dalai »

Not sure what a search string containing a semi-colon tries to find, so I can't explain the search results you get with that (hence I didn't say anything about it).
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6497
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: [TC11.02] Inaccurate file search results

Post by *Horst.Epp »

andry81 wrote: 2023-12-27, 15:59 UTC 2Dalai

This does not explain why the `aaa bbb.txt;bbb.txt` search is missed to find the `aaa bbb.txt` file.
The ; is a normal character in filenames.
There is no file named `aaa bbb.txt;bbb.txt` in your list, so why should TC find one ?
Windows 11 Home x64 Version 23H2 (OS Build 22631.3527)
TC 11.03 x64 / x86
Everything 1.5.0.1373a (x64), Everything Toolbar 1.3.3, Listary Pro 6.3.0.73
QAP 11.6.3.2 x64
User avatar
sqa_wizard
Power Member
Power Member
Posts: 3864
Joined: 2003-02-06, 11:41 UTC
Location: Germany

Re: [TC11.02] Inaccurate file search results

Post by *sqa_wizard »

Nevertheless:

Code: Select all

Search: aaa ccc
This will not find "aaa bbb.txt" either, but it should search for aaa as well as ccc as a part of a filename

While:

Code: Select all

Search: aaa
This will find "aaa bbb.txt" as defined
#5767 Personal license
andry81
Junior Member
Junior Member
Posts: 97
Joined: 2018-11-22, 19:17 UTC

Re: [TC11.02] Inaccurate file search results

Post by *andry81 »

2Horst.Epp
The ; is a normal character in filenames.
There is no file named `aaa bbb.txt;bbb.txt` in your list, so why should TC find one ?
But it finds `bbb.txt`, which means it is not just a normal character.
User avatar
Dalai
Power Member
Power Member
Posts: 9393
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: [TC11.02] Inaccurate file search results

Post by *Dalai »

2sqa_wizard
It looks like the wildcard (glob) search gets disabled in case of multiple search terms - just as when there's a single term with a dot in it. Example: "txt foo" won't find "aaa bbb.txt" either, but "txt" will.

It's the same topic discussed in the past about glob search and exact matches. I don't think it's necessary to repeat the same arguments over and over again.

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

Re: [TC11.02] Inaccurate file search results

Post by *petermad »

There are some problems with Search for with spaces but no quotes. The Help says:
Help wrote:Names with spaces do not need to be put in double quotes, e.g. Letter to Mr. Smith.doc, Total Commander looks for both the entire name and the name parts individually.
But if i make thes files:
Letter to Mr. Smith.doc
Letter
to
Mr
Smith

then I get these results:
Search for: Letter to Mr. Smith.doc
Finds:
Letter
to
Mr
Letter to Mr. Smith.doc
as expected

Search for: Letter to Mr. Smith
Finds:
Letter
to
Mr
Smith
as expected

Search for: Letter to Mr Smith (no dot after Mr)
Finds: Nothing
Expected:
Letter
to
Mr
Smith

Search for: Letter to Mr. (with dot after Mr)
Finds:
Letter
to
Mr
Expected:
Letter
to
Mr
Letter to Mr. Smith.doc

Search for: Letter to Mr (no dot after Mr)
Finds:
Letter to Mr. Smith.doc
Expected:
Letter
to
Mr

Search for: Letter to
Finds:
Letter to Mr. Smith.doc
Expected:
Letter
to
Letter to Mr. Smith.doc

Search for: Letter Mr (no dot after Mr)
Finds: Nothing
Expected:
Letter
Mr

Search for: Letter Mr. (with dot after Mr)
Finds:
Letter
Mr
as expected

There seem to be problems finding files without extension if there is not a dot in the Search string.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
white
Power Member
Power Member
Posts: 4623
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: [TC11.02] Inaccurate file search results

Post by *white »

2petermad
white wrote: 2023-04-01, 20:10 UTC Confusion about Total Commander's Search for field is understandable. It's quite complex and the help text is not very clear. Here is my understanding of the feature.

There are 2 search modes:

Condition for search mode Description of search mode
The Search for field does NOT contain a dot, wildcard or backslash Find filenames where part of the filename matches the entire Search for field.

Notes:
  • Spaces and the pipe symbol have no special meaning and are interpreted literally.

    So be careful with the number of spaces and leading and trailing spaces.
    Searching for "test|crap" will not find a file named "test".
  • A double quote character at the beginning and an optional matching quote character are ignored.

    So the following search terms have the same results:
    Total Commander
    "Total Commander"
    "Total Com"mander

The Search for field DOES contain a dot, wildcard or backslash Find filenames where
⠀(a) the whole filename matches one of the expressions in the Search for field
or
⠀(b) the whole filename matches the entire Search for field (no character is interpreted as separator character and the entire Search for field is seen as 1 expression).

Notes:
  • The space character is a separator character except when inside a quoted text.
  • The backslash character and the pipe character have special meaning as explained in Help.
  • When the Search for field contains a backslash or the pipe character, (b) is not done or gives no results.

User avatar
petermad
Power Member
Power Member
Posts: 14809
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: [TC11.02] Inaccurate file search results

Post by *petermad »

2white
I guess that your table is a correct interpretation.

But I still find it illogical that
Search for: Letter to mr
Finds: nothing

when
Search for: Letter to mr . (SPACE and dot after Mr)
finds:
Letter
to
Mr

to me, it would be more logic if the second search did not find anything, since there is no filename with just a dot in it (except for the folder itself, but it is not listed in the result).
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
gdpr deleted 6
Power Member
Power Member
Posts: 872
Joined: 2013-09-04, 14:07 UTC

Re: [TC11.02] Inaccurate file search results

Post by *gdpr deleted 6 »

2white
your table explains parts of TC's arcane "Find File" search mask rules nicely in a comprehensible manner. 8)
Too bad something like it didn't (yet?) find its way into TC's help file... :(
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [TC11.02] Inaccurate file search results

Post by *ghisler(Author) »

Moderator message

Moved to will not be changed
Author of Total Commander
https://www.ghisler.com
Post Reply