Page 1 of 1

Find files: Do not search in subdirectories of ...

Posted: 2015-11-13, 18:12 UTC
by DrShark
It has something similar to "Ignore list", "IgnoreLinks" or "Search in subdirectories" TC options, as well as some of my previous suggestions, but with some differences.

I suggest to add to internal TC plugin new property "IgnoreSubdirsOf" with OP "contains"* and Value available for custom path. Other Content plugins options applied as a filter after search is done, but this should act like an opposite of "Search in subdirectories" Find files option, so TC wouldn't even try to find anything in/under* path set for IgnoreSubdirsOf rule. Main "Search in subdirectories" setting must be ignored in relation of IgnoreSubdirsOf rules.

* for IgnoreSubdirsOf proprety different OPs may exist, making deep level adjustable a little bit:
OP "containsall" may tell TC not to search anything under Value path;
OP "containssubdirs" - not to search under subdirs of value path, making files in root of Value path still available for search

This way user can save several search templates with different rules.

Posted: 2015-11-13, 18:57 UTC
by Dalai
I don't get it. Where's the difference to a search using plugins:

Code: Select all

tc | path | !contains | <your_value_here>
This way, you can already ignore certain directories while searching.

Regards
Dalai

Posted: 2015-11-13, 20:17 UTC
by MVV
Dalai,
Actually you can't ignore directories while searching, you only can filter them out from search results, but TC will enumerate their contents and check names/attributes/plugins anyway.

Posted: 2015-11-13, 21:10 UTC
by Dalai
Ah, you're right. That enumeration should be pretty fast, though, since the name is the first thing known about a file/directory. However, if it's a deep directory structure, it could take a while, so it would indeed be nice to be able to skip it during search.

Selecting directories (and using the option "Only search in selected directories/files") might be able to limit the search to the directories one needs to find files in. And, let's see what TC9 with the integration of Everthing has to offer. Nonetheless, it would be a nice feature.

Regards
Dalai

Posted: 2015-11-13, 21:57 UTC
by DrShark
Well, in TC 8.0x I had a problem that I don't see currently in TC 8.52a, and that problem was a primary target of my suggestion, because I did't want to use IgnoreLinks while still having certain locations blocked only for search.
I had a following path:
c:\Users\username\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\Folder\AppData\
Here AppData (green-colored) is a junction to AppData (yellow-colored; may be black colored in some browsers).
It made the infinite loop with search, so when search for some name in
c:\Users\username\AppData\
I also got it for
c:\Users\username\AppData\...\AppData\...
and
c:\Users\username\AppData\...\AppData\...\AppData\...
etc.
MVV gave a basic description why it could happen. In TC 8.52a I don't get such loops in search, even without any Ignore-related option active, so it seems that TC handles now this special case with junctions.

Still my suggestion will be helpful for deep directory structures.

Posted: 2015-11-13, 22:43 UTC
by Dalai
2DrShark
Do you know that you can toggle the ignore list using cm_SwitchIgnoreList on a button or the start menu (or even the command line)? I know that it's not the same like your suggestion, but it might make thing easier.

And, yes, TC 8.50 (IIRC) has some recognition of infinite loops, which is especially helpful for directories like AppData.

Regards
Dalai

Posted: 2015-11-14, 09:37 UTC
by MVV
Ignore list isn't too much usable for e.g. ignoring junctions/symlinks because every link must be added to it explicitly.

It would be much nicer to be able to ignore directories using plugin fields. But currently I think plugins tab is mostly for files. :!:
Perhaps an option to skip directory contents if it is rejected by some plugin could help but it would be hard to mix plugin definitions for files and folders, separate plugins tab for dirs would help.
Dalai wrote:That enumeration should be pretty fast, though, since the name is the first thing known about a file/directory.
It depends on attributes/fields check order. E.g. if you search for text in files, I don't know what TC checks first, file contents or plugin fields etc.