cm_SearchFor No files found

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

User avatar
white
Power Member
Power Member
Posts: 4576
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: cm_SearchFor No files found

Post by *white »

ghisler(Author) wrote: 2022-09-01, 08:01 UTC The reason is simple: ...
I think the behavior is not intuitive and not consistent. I made a suggestion to improve it here:
https://www.ghisler.ch/board/viewtopic.php?t=77493
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48005
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: cm_SearchFor No files found

Post by *ghisler(Author) »

Well, if it were simple to change, I would have done that a long time ago...
Author of Total Commander
https://www.ghisler.com
User avatar
petermad
Power Member
Power Member
Posts: 14700
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: cm_SearchFor No files found

Post by *petermad »

ghisler(Author) wrote: 2022-09-01, 08:01 UTC
Yes, this is what I am confused, "subdir1\ *.bar" does work, but "subdir1\subdir2\ *.bar" doesn't work.
The reason is simple: TC starts the search at the "Search in" directory. When you have specified directories in which it should search, it will check whether any of the directories in "Search in" match, and if yes, search in them. This works when you specify subdir1\, but will not work when you specify subdir1\subdir2\, because subdir1 was not searched. Therefore subdir2 is never encountered and will not be searched either.

However, when you EXCLUDE subdir1\subdir2\ via something like
*.* | subdir1\subdir2\
then you did not put any rules where TC is allowed to search, just where it isn't allowed. So when it goes through the directories in the "Search in" directory, it sees that subdir1 isn't forbidden, and searches in it. Then inside of subdir1 it sees that subdir2 is forbidden, and doesn't search there.

Then the Help really needs to clarify this - right now it says:
To include/exclude certain directories in the search, wildcards can be used in include/exclude directory names, and the names must have a trailing backslash \ . Directories can be found anywhere, or relative to the search start directory:
1. Relative to the search start directory: \subdir1\ or \subdir1\subdir2\ or \
2. Relative to any subdirectory: subdir1\ or subdir1\subdir2\ (no backslash at the start)
And it mentions subdir1\subdir2\ for both inclusion and exclusion.


Maybe something like this would help the understanding:
To include/exclude certain directories in the search, wildcards can be used in include/exclude directory names, and the names must have a trailing backslash \ . Directories can be found anywhere, or relative to the search start directory:
1. Relative to the search start directory: \subdir1\ (include/exclude) or \subdir1\subdir2\ (only exclusion) or \
2. Relative to any subdirectory (no backslash at the start): subdir1\ (exclusion and 1st level for inclusion) or subdir1\subdir2\ (only exclusion)
It is a little tough to explain for inclusion since both \subdir1\ and subdir1\ only works for 1st level.

Or maybe split it up like:
To include certain directories in the search, wildcards can be used in include directory names, and the names must have a trailing backslash \ . Directories can only be found relative to the search start directory: subdir1\

To exclude certain directories in the search, wildcards can be used in exclude directory names, and the names must have a trailing backslash \ . Directories can be excluded anywhere, or relative to the search start directory:
1. Relative to the search start directory: |\subdir1\ or |\subdir1\subdir2\ or \
2. Relative to any subdirectory: |subdir1\ or |subdir1\subdir2\ (no backslash at the start)
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.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
white
Power Member
Power Member
Posts: 4576
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: cm_SearchFor No files found

Post by *white »

ghisler(Author) wrote: 2022-09-01, 09:55 UTC Well, if it were simple to change, I would have done that a long time ago...
In my opinion this is one of the worst "features" of Total Commander. So in my opinion it's worth considering even if it is not easy.

My suggestion for the include subdirectories feature probably makes it simpler and is very similar to excluding subdirectories. Maybe it's doable.
User avatar
petermad
Power Member
Power Member
Posts: 14700
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: cm_SearchFor No files found

Post by *petermad »

Help is unchanged (and still wrong) for including subdirs in TC 10.51 final.

Anyway - i Support white's suggestion: viewtopic.php?t=77493
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.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Post Reply