Search including \subdir\subdir\ not working
Moderators: Hacker, petermad, Stefan2, white
- ghisler(Author)
- Site Admin
- Posts: 50386
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: Search including \subdir\subdir\ not working
This should be fixed in 11.50 beta 2, please check!
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: Search including \subdir\subdir\ not working
Moderator message from: white » 2024-10-16, 18:42 UTC
I swapped this post with your post here because it was in the wrong thread.
Above cases now work.white wrote: 2024-10-12, 11:51 UTC In Windows Sandbox, I installed Total Commander in the default folder (c:\Program Files\totalcmd\).
I search in "c:\" for the following searches:
...The contents of the totalcmd folder is not found.Code: Select all
"program files\totalcmd\"
The contents of the totalcmd folder is not found.Code: Select all
totalcmd\
Earlier you mentioned:
That's why I tested:ghisler(Author) wrote: 2024-07-15, 16:42 UTC because it means that TC would have to search trough all subdirectories. For that, the user will have to use:
*.ini \**\usbhub\04*\
I don't know if you intended for it to work, but it partially works. But it does not traverse the folder c:\totalcmd if there is one. (BTW there is a bug when using ** in file mask as well.)
This also does not work:
Code: Select all
totalcmd\**\
Since TC 11.50b2, this search means something different:
Code: Select all
\
It was a search to only search in the folder at the start and don't traverse in any folder (fast).
But now it means: \*
So now all subfolders are searched which is of course very slow.
- ghisler(Author)
- Site Admin
- Posts: 50386
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: Search including \subdir\subdir\ not working
\**\ stands for one or more folders, so it will not find c:\totalcmd when starting in c:\, but it will find "c:\Program Files\Totalcmd" and also "c:\Program Files\GhislerTotalcmd". If you want to find totalcmd anywhere, use\**\totalcmd\
I don't know if you intended for it to work, but it partially works. But it does not traverse the folder c:\totalcmd if there is one.
totalcmd\
instead.
This isn't currently supported, so it does what you say (find only \*\). I will try to add ittotalcmd\**\
It still does, but TC starts searching subdirs only for no reason (but doesn't find anything extra). I will fix it.It used to mean: <empty folder name>\ *
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: Search including \subdir\subdir\ not working
That doesn't make sense, the purpose of a variable number of nested subfolders is that it is variable, not that it has a minimum number. It is not intuitive and you make it very hard if \**\ in the middle or at the end, for example: subdir\**\totalcmd\
See also this post.
Re: Search including \subdir\subdir\ not working
Tested OK using TC 11.50b3 32-bit and 64-bit. I wasn't able to find something that didn't work.HISTORY.TXT wrote: 22.10.24 Added: Find files: *.ext | \ will find files with extension ".ext" in subdirectories but not the base directory of the search (32/64)
..
17.10.24 Fixed: Find files: \**\ at the end of a search string was interpreted as \*\ (exactly one directory) (32/64)
17.10.24 Fixed: Find files: \**\ in the middle of a search string was sometimes treated as 0 or more directories, sometimes as 1 or more. Now it's always 0 or more (32/64)
17.10.24 Fixed: Find files: Ignore/Remove \**\ or **\ at the start if a search name, searching for \**\dir\*.ext is the same as dir\*.ext (32/64)
17.10.24 Fixed: Find files: when searching for a single backslash \ (meaning limit to current directory) we don't need to search all subdirectories (32/64)
So using traverse filters is implemented such that subfolders are traversed into if they match a traverse filter, but when a match is encountered the folder is traversed into but not its subfolders. If you want to include subfolders as well you will have to add **\
Example:
Find all files/folders in folders named "totalcmd"
Code: Select all
Search for: totalcmd\ | \
Search in: c:\
Code: Select all
Search for: totalcmd\**\ | \
Search in: c:\
Code: Select all
Search for: totalcmd\*
Search in: c:\
Code: Select all
Search for: totalcmd\**\*
Search in: c:\
It should be added to the help page "Find files: General" that \**\ in a path means zero or more subfolders.
- ghisler(Author)
- Site Admin
- Posts: 50386
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: Search including \subdir\subdir\ not working
What would you think about the following help text?
I would add this below the text\**\ can be used to find 0 or more directories, e.g. \subdir1\**\subdir2\
End the path with \**\ to also find files in subdirectories, e.g. \subdir1\subdir2\**\
on the page Find file - General.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)
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: Search including \subdir\subdir\ not working
How about adding the info about \**\ to the info about wildcards at the beginning, for example like this:
And add 2 examples to the list of examples, for example like this: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. The special wildcard \**\ can be used in paths and stands for any number of subfolders.
Furthermore, I think the text:Examples:
*.ini finds for example win.ini
Smith finds "Letter to Mr. Smith.doc"
*.bak *.sik *.old finds all backup files with these extensions
*n.ini finds names which must contain an 'n' in front of the dot.
*wof*.doc finds all names containing "wof" in the name and an extension ".doc".
dir1\**\dir2\*.dll finds dll files only in dir2\, where dir2\ is located within dir1\ at any level
w*.*|*.bak *.old finds files, which start with w and do not end with .bak or .old.
*.ini | windows\ finds all ini files except those in directories called "Windows" and their subdirs.
*.htm? | _vti*\ finds all html files, except in subdirs starting with _vti (used by Frontpage)
windows\ system32\ *.ini finds ini files only in windows\ and system32 dirs
totalcmd\**\ | \ finds all files/folders within total commander directories (including its subdirectories)
might confuse people into thinking that only these directories are searched (and not the directory where the search starts). That's why I started to call them traverse filters in the wiki. This help text might be less confusing in that regard: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)
To include/exclude certain directories from being traversed into during the search, traverse filters can be included. You do this by including an expression for one or more directory names which must end with a backslash (\). If a filter starts with a backslash, it applies to the search location only, not subfolders. For example:
1. subdir1\ or subdir1\subdir2\ are matched against any subdirectory.
2. \subdir1\ or \subdir1\subdir2\ or \ are matched against the search location only, not its subfolders.
- ghisler(Author)
- Site Admin
- Posts: 50386
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: Search including \subdir\subdir\ not working
I agree with most of your suggestions, except for the last one:
This is also a bit confusing, because the filter isn't actually applied to the search location (e.g. when you start in c:\windows, the search location would be "windows"), but to folders directly within the search location. How about this:To include/exclude certain directories from being traversed into during the search, traverse filters can be included. You do this by including an expression for one or more directory names which must end with a backslash (\). If a filter starts with a backslash, it applies to the search location only, not subfolders. For example:
1. subdir1\ or subdir1\subdir2\ are matched against any subdirectory.
2. \subdir1\ or \subdir1\subdir2\ or \ are matched against the search location only, not its subfolders.
To include/exclude certain directories from being traversed into during the search, traverse filters can be included. You do this by including an expression for one or more directory names which must end with a backslash (\). If a filter starts with a backslash, it applies to subfolders directly in the search location only, not to subfolders of them. For example:
1. subdir1\ or subdir1\subdir2\ are matched against subdirectories anywhere below the search location.
2. \subdir1\ or \subdir1\subdir2\ or \ are matched against subdirectories directly in the search location only, not in its subfolders.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: Search including \subdir\subdir\ not working
Agreed. Except be consistent in using either using "folders" or directories". I tried to be consistent with the current help text and meant to use directories everywhere, but I slipped up and used both terms. And now you do tooghisler(Author) wrote: 2024-10-28, 08:29 UTC This is also a bit confusing, because the filter isn't actually applied to the search location (e.g. when you start in c:\windows, the search location would be "windows"), but to folders directly within the search location. How about this:
To include/exclude certain directories from being traversed into during the search, traverse filters can be included. You do this by including an expression for one or more directory names which must end with a backslash (\). If a filter starts with a backslash, it applies to subfolders directly in the search location only, not to subfolders of them. For example:
1. subdir1\ or subdir1\subdir2\ are matched against subdirectories anywhere below the search location.
2. \subdir1\ or \subdir1\subdir2\ or \ are matched against subdirectories directly in the search location only, not in its subfolders.

- ghisler(Author)
- Site Admin
- Posts: 50386
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: Search including \subdir\subdir\ not working
Folders is the umbrella term for both directories and virtual folders. It's not wrong to write about subfolders here, although the search can't handle virtual folders. But it may be better to make it consistent.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
- ghisler(Author)
- Site Admin
- Posts: 50386
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: Search including \subdir\subdir\ not working
Please check the help changes in beta 4.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: Search including \subdir\subdir\ not working
I have checked. Changes are OK, except for the following:
I seem to have added:
My idea was to state at the beginning that you can use \**\ anywhere in paths, which you did now, and provide a few examples to provide further clarity, which you also did. That way we can keep the explanation simply and focused on its basic function. So I think you should leave this text out. What you are trying to convey here, is explained already.\**\ can be used to find 0 or more directories, e.g. \subdir1\**\subdir2\
End the path with \**\ to also find files in subdirectories, e.g. \subdir1\subdir2\**\
Also, the next line:
should be removed now. There is no need anymore to explain that all subdirectories are excluded too, because we explained the feature now in terms of traversing through directories. It's now already obvious that when a directory is not traversed into that all subdirectories are not traversed into as well. Furthermore, using the phrase "exclude a directory" is not clear, that's why described it differently now.If you exclude a directory, all its subdirectories will be excluded too.
- ghisler(Author)
- Site Admin
- Posts: 50386
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: Search including \subdir\subdir\ not working
I agree with leaving out this line:
But where is this explained:\**\ can be used to find 0 or more directories, e.g. \subdir1\**\subdir2\
End the path with \**\ to also find files in subdirectories, e.g. \subdir1\subdir2\**\
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: Search including \subdir\subdir\ not working
These lines:ghisler(Author) wrote: 2024-11-01, 16:27 UTC But where is this explained:End the path with \**\ to also find files in subdirectories, e.g. \subdir1\subdir2\**\
But I agree it is useful to let this line in there if you remove the other two lines.The special wildcard \**\ can be used in paths and stands for any number of subdirectories.
...
totalcmd\**\ | \ finds all files/directories within total commander directories (including its subdirectories), | \ excludes the base directory
- ghisler(Author)
- Site Admin
- Posts: 50386
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: Search including \subdir\subdir\ not working
OK, then I will remove just the other two lines.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com