I will mark this topic as Solved, then - since the original problem wiyh wildcards IS solved.Since we can't come to an agreement here, I will move this thread to "will not be changed" soon.
solved [TC 10.50] Unexpected search result for list search with wildcards
Moderators: Hacker, petermad, Stefan2, white
Re: [TC 10.50] Unexpected search result for list search
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Re: [TC 10.50] Unexpected search result for list search
But now search depth is shifted for some entries in a search list and not for others. This is wrong too.ghisler(Author) wrote: 2022-08-14, 06:48 UTC The idea was that you could load a list of files and folders into the program via the search function, so they only get added when they exist. I will probably break a lot of saved searches if I changed that now. In the case of c:\path\*.ext it was logical to change it because the result was definitely wrong.
Consider searching using a search list in a file (@c:\test\list.txt).
Note that the option "search in subdirectories" does not apply to files in the list, but only to folders and to entries that contain a wildcard expression or regular expression.
Now in TC version 10.51, when the expressions are searched with search depth X, the folders are searched with search depth X-1.
An illustration:
Create the following files (with any content) and folder structure:
Also create the file "c:\test\list.txt" with contents:c:\test\Folder A\file.txt
c:\test\Folder A\Level 1\file.txt
c:\test\Folder A\Level 1\Level 2\file.txt
c:\test\Folder B\file.txt
c:\test\Folder B\Level 1\file.txt
c:\test\Folder B\Level 1\Level 2\file.txt
Open Search (Alt+F7) and set the following options:c:\test\Folder A\
c:\test\Folder B\*.txt
Code: Select all
Search for: *.txt
Search in: @c:\test\list.txt
Searching with "Search in subdirectories" set to "current dir only" (search depth 0)
- The "Search for" field is ignored and Folder A is not searched, instead the result is simply the folder, if it exists. (This is not obvious.)
- Folder B is searched at base level (search depth 0)
- The results are:
[1 files and 1 directories found]
[c:\test\Folder A]
c:\test\Folder B\file.txt
- Folder A is searched with search depth 0
- Folder B is searched with search depth 1
- The results are:
[3 files and 0 directories found]
c:\test\Folder A\file.txt
c:\test\Folder B\file.txt
c:\test\Folder B\Level 1\file.txt
- Folder A is searched with search depth 1
- Folder B is searched with search depth 2
- The results are:
[5 files and 0 directories found]
c:\test\Folder A\file.txt
c:\test\Folder A\Level 1\file.txt
c:\test\Folder B\file.txt
c:\test\Folder B\Level 1\file.txt
c:\test\Folder B\Level 1\Level 2\file.txt
You say this is really debatable. I gave you my arguments why this is wrong (the misuse of "current dir only" option which isn't obvious, search depth is shifted for some entries and not for others).ghisler(Author) wrote: 2022-08-14, 06:48 UTC But in the other cases it's really debatable which one is right and which one is wrong.
What are your arguments why this is right?
You should at least explain the behavior in the help. Which is quite hard and complex.
- ghisler(Author)
- Site Admin
- Posts: 50421
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: Solved [TC 10.50] Unexpected search result for list search with wildcards
Well, the previous result for c:\path\wildcards was clearly wrong, so no harm should be done by changing that.But now search depth is shifted for some entries in a search list and not for others. This is wrong too.
There is a clear difference betweenWhat are your arguments why this is right?
c:\path
and
c:\path\*.extension
In the first case, finding just c:\path would be the lowest possible level.
In the second case, it clearly tells us that we want to find the files *.extension inside c:\path, so that would be the lowest possible level.
Also there would be no way to find just the files and folders themselves in the list file if I changed it.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: Solved [TC 10.50] Unexpected search result for list search with wildcards
It wasn't that clearly wrong if people used for example level 1 or 2. Any saved searches like that are now broken.ghisler(Author) wrote: 2022-08-19, 08:08 UTCWell, the previous result for c:\path\wildcards was clearly wrong, so no harm should be done by changing that.But now search depth is shifted for some entries in a search list and not for others. This is wrong too.
And as I explained search depth is now out of sync with other entries.
That's not true. If finding just c:\path is the lowest possible level then searching with higher search depths would find additional results. Searching with level 1 would result in:ghisler(Author) wrote: 2022-08-19, 08:08 UTCThere is a clear difference betweenWhat are your arguments why this is right?
c:\path
and
c:\path\*.extension
In the first case, finding just c:\path would be the lowest possible level.
In the second case, it clearly tells us that we want to find the files *.extension inside c:\path, so that would be the lowest possible level.
c:\path
c:\path\file1.txt
c:\path\file2.txt
c:\path\program.exe
...
That is not the case. Searching at level 1 currently searches for whatever is in the Search for field and searches for that inside c:\path at the lowest possible level. And searching with level 2 and up finds additional results.
Finding just c:\path is not the lowest possible level. It's an entirely different search.
A possible solution to this is to add a new "file/folder list only" item to the "Search in subdirectories" drop-down list for exactly this purpose.ghisler(Author) wrote: 2022-08-19, 08:08 UTC Also there would be no way to find just the files and folders themselves in the list file if I changed it.
The downside of this is:
Incompatibility with saved searches which search using a file list and a limited search level.
The upside of this is:
It is easier to understand and possible to explain well in the help. Currently the functionality is there, but quite incomprehensible.
- ghisler(Author)
- Site Admin
- Posts: 50421
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: Solved [TC 10.50] Unexpected search result for list search with wildcards
The only way to prevent that would be to revert to the behaviour in TC 10.50 and older, with one important change:It wasn't that clearly wrong if people used for example level 1 or 2. Any saved searches like that are now broken.
Searching for c:\path\*.wildcards with "current dir only" would then find nothing at all.
This way the stored searches with level 1 or 2 would remain unchanged, and level 0 would return nothing for this specific search. Of course this would have to be explained in the help.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: Solved [TC 10.50] Unexpected search result for list search with wildcards
Correct, I had thought about that solution too and doubted to mention it. It solves the compatibility issue and becomes easier to explain in help.ghisler(Author) wrote: 2022-08-21, 08:22 UTCThe only way to prevent that would be to revert to the behaviour in TC 10.50 and older, with one important change:It wasn't that clearly wrong if people used for example level 1 or 2. Any saved searches like that are now broken.
Searching for c:\path\*.wildcards with "current dir only" would then find nothing at all.
This way the stored searches with level 1 or 2 would remain unchanged, and level 0 would return nothing for this specific search. Of course this would have to be explained in the help.
The downside remains that it remains hard to understand and confusing for the user that when searching in search results or in a list in a file, the search depths options are shifted and searching at the lowest level means something else.
But for now this may be the best solution since you are now working on a minor TC update.
- ghisler(Author)
- Site Admin
- Posts: 50421
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: Solved [TC 10.50] Unexpected search result for list search with wildcards
OK, I will change it like that in RC3.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: Solved [TC 10.50] Unexpected search result for list search with wildcards
Could you issue warning message for such cases? For example "You haven't allowed search in subdirs".ghisler(Author) wrote: 2022-08-21, 08:22 UTCSearching for c:\path\*.wildcards with "current dir only" would then find nothing at all.
Andrzej P. Wozniak
Polish subforum moderator
Polish subforum moderator
- ghisler(Author)
- Site Admin
- Posts: 50421
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: Solved [TC 10.50] Unexpected search result for list search with wildcards
I have also thought about this. I will show the following as the first result:
[No files found] WARNING! "Current dir only" + "*.dll"
with *.dll the first wildcards found in the list file.
Here is the description I will put in the help:
[No files found] WARNING! "Current dir only" + "*.dll"
with *.dll the first wildcards found in the list file.
Here is the description I will put in the help:
What do you think?Important: If the search depth is limited to "Current directory only", only the files and directories in the list file will be found, no files inside of the listed directories and no wildcards. With a depth of 1 level, the specified directories will be searched, with or without wildcards. With 2 levels, sub-directories found within the specified directories will be searched, etc.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: Solved [TC 10.50] Unexpected search result for list search with wildcards
That sound good to me.Here is the description I will put in the help:What do you think?Important: If the search depth is limited to "Current directory only", only the files and directories in the list file will be found, no files inside of the listed directories and no wildcards. With a depth of 1 level, the specified directories will be searched, with or without wildcards. With 2 levels, sub-directories found within the specified directories will be searched, etc.
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Re: Solved [TC 10.50] Unexpected search result for list search with wildcards
I assume you want to add that to the Help about "Search in"?ghisler(Author) wrote: 2022-08-22, 06:46 UTC Here is the description I will put in the help:Important: If the search depth is limited to "Current directory only", only the files and directories in the list file will be found, no files inside of the listed directories and no wildcards. With a depth of 1 level, the specified directories will be searched, with or without wildcards. With 2 levels, sub-directories found within the specified directories will be searched, etc.
How about:
Search in:
Here you can enter one or more starting directories, separated by ";". You can also start the search inside an archive.
Put '>' character in this field before saving the search to keep the "Search in" field unchanged when loading the saved search.
You can enter the name of a text file (ANSI, UTF-8 or UTF-16, the latter two with BOM) containing a list of files and directories to be searched, in the form @c:\path\filelist.txt. The file must contain one file or directory name per line, either an absolute path, or relative to the location of the list file. Wildcards and regular expressions are also supported, but not in paths. Use the character '<' to indicate the start of a regular expression.
Important: If the search depth is limited to "Current directory only", only the files and directories in the list file will be found. The "Search for" field is ignored and lines containing wildcards or regular expressions will not be searched. With a search depth of 1 or higher, the "Search for" field is not ignored and inside the specified directories will be the base level for the search.
Sample list: Description c:\testdir\filename.txt Searches just for "filename.txt" in "c:\testdir" (search depth has no effect) c:\testdir\ Searches inside "c:\testdir" for search string defined in "Search for" (search depth 1 or higher)
Only searches for "c:\testdir" itself, ignores search string defined in "Search for" (search current dir only)c:\testdir\*.txt *.doc Searches "c:\testdir" for txt and doc files (search depth 1 or higher) c:\testdir\<regular expression Searches "c:\testdir" using regular expression (search depth 1 or higher)
F2 Search in found files/folders
If checked, the next search will be performed only within the displayed search results.
Important: If the search depth is limited to "Current directory only", only the list itself is searched, so the result is a subset of the current search results. With a search depth of 1 or higher, directories listed in the search results will be searched within, so these directories themselves will not be in the results.
Re: Solved [TC 10.50] Unexpected search result for list search with wildcards
Based on the history this should be moved to "TC Behaviour which will not be changed"history.txt wrote:22.08.22 Fixed: Search, use list file in "Search in", e.g. @c:\totalcmd\list.txt: Ignore lines containing wildcards like *.dll when search depth is set to "current dir only" (32/64)
10.08.22 Fixed: NOTE: THIS WAS CHANGED BACK IN RC3: Search, use list file in "Search in", e.g. @c:\totalcmd\list.txt containing wildcards like *.dll: "Search in subdirectories" was off by 1, e.g. "1 levels" only searched the base directory (32/64)
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Re: Solved [TC 10.50] Unexpected search result for list search with wildcards
2ghisler(Author)
Did you consider my suggestions for the help?
Well, the behavior did change. And an explanation was added to the help. Don't you consider it fixed?petermad wrote: 2022-08-24, 15:11 UTC Based on the history this should be moved to "TC Behaviour which will not be changed"
- ghisler(Author)
- Site Admin
- Posts: 50421
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: Will not be changed [TC 10.50] Unexpected search result for list search with wildcards
2white
I used some of your suggestions for the help.
I used some of your suggestions for the help.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: Will not be changed [TC 10.50] Unexpected search result for list search with wildcards
2white

You are right - the weird [C:\totalcmd\} results from my first post is no longer there, and the help explains the behaviour - so: confirmed fixedWell, the behavior did change. And an explanation was added to the help. Don't you consider it fixed?

License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar