Find Files, Search in subdirectories: setting the depth level for each dir of 'Search in:' field

Here you can propose new features, make suggestions etc.

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

Find Files, Search in subdirectories: setting the depth level for each dir of 'Search in:' field

Post by *DrShark »

Currently it's possible to set only a global depth level for search with a "Search in subdirectories" setting, so in the case when many folders are placed in "Search in" field, latest level of each is used as a start point for subdirictories number set in "Search in subdirectories".

In addition to this current feature, I suggest to add the ability to set the depth levet separately for each dir directly in "Search in:" field to make a depth level for certain dirs there even lower or higher than global one set in "Search in subdirectories".

My ideas is to set the number of such depth levels with an backslash with following asterisk. Example:

Code: Select all

c:\dir1;c:\dir2\*;c:\dir3\*\*;c:\dir3\*\*\*
Here for c:\dir1 TC uses global depth level set by "Search in subdirectories" option.
For c:\dir2\* the depth level is current directory (dir2 itself).
For c:\dir3\*\* and c:\dir3\*\*\* the depth levels are 1 and 2 respectively.

Backslash+asterinsk can also be threated as a depth level marker for paths to search in of the text file list (which path in "Search in:" should start with at-sign (@, e.g. @c:\list.txt).)

Note 1. The asterisks (*) and question mark (?) usually are used as wildcards in context of a search, but in "Search in:" field of Total Commander these characters currently not supported as wildcards, or for any other meaning.
But if they will be supported here, it shouldn't harm the suggestion above because only backslash+asterinsk with no characters in between should be treated as a marker of depth level.
For example,

Code: Select all

c:\t*cmd*\*
would find everything in the roots of the dirs matrching a t*cmd* mask under c:\, but not further.
So it would find e.g. c:\totalcmd\Plugins but not c:\totalcmd\Plugins\WCX.

Note 2. Regarding backward compatibility.
Current (then-older) Total Commander version usually will skips the paths containing more than 2 asterisks, although not silently - error messages will be shown like this one:

Code: Select all

---------------------------
Total Commander
---------------------------
Search path not found!            
c:\*\*
---------------------------
OK
---------------------------
If there is only one asterisk in "Search in:" field, e.g. we put just c:\*, it looks like Total Commander is briefly searching somewhere, but here it finds nothing even is asterisk the only character of "Search for:" field, so I wonder where TC is serching in this case.

Anyway, the searches with asterisks saved as templates in Load/Save Find Files' tab shouldn't really break anything for older TC versions using the same wincmd.ini file.
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
Post Reply