Find Files plugins

Here you can propose new features, make suggestions etc.

Moderators: white, Hacker, petermad, Stefan2

Post Reply
yrwin
Junior Member
Junior Member
Posts: 4
Joined: 2013-09-27, 15:38 UTC

Find Files plugins

Post by *yrwin »

Allow other developers to extend Find Files dialog with custom engine. So we can use more search algorithms.

I look forward to when it's finished :)

I done skeleton of the plugin interface, if it helps. I try to put here everything i find useful. Ofc feel free to change/update it in post, i'll try to update my code asap so it should reflect the latest informations.
This interface should solve the Hacker requests too.

findplugin.h:

Code: Select all

typedef DWORD tSearchFlags;
#define SEARCH_FLAGS_FOR_REGEX        1     // valid is SearchFor (instead of SearchForArray) is in regex format.
#define SEARCH_FLAGS_IN_ARCHIVES      2
#define SEARCH_FLAGS_WHOLE_WORDS_ONLY 4
#define SEARCH_FLAGS_CASE_SENSITIVE   8
#define SEARCH_FLAGS_ASCII_CHARSET    0x10
#define SEARCH_FLAGS_NOT_IN_FILE      0x20
#define SEARCH_FLAGS_UNICODE          0x40
#define SEARCH_FLAGS_HEX              0x80
#define SEARCH_FLAGS_FIND_TEXT_REGEX  0x100 // Value in FindText is in regex format.
#define SEARCH_FLAGS_UTF8             0x200

#define SEARCH_DEPTH_UNLIMITED        0xffffffff

static const FILETIME    = {0xffffffff, 0xffffffff};

typedef enum {
    GreaterThan,
    LessThan,
    GreaterOrEqualThan,
    LessOrEqualThan,
    Equal,
    NotEqual,
    Contains,
    NotContains,
    ContainsCaseInsensitive,
    NotContainsCaseInsensitive,
    EqualCaseInsensitive,
    NotEqualCaseInsensitive,
    MatchesRegex,
    NotMatchesRegex,
} tComparisonOP;

typedef struct {
    WCHAR* Plugin;                    // Field Plugin:
    WCHAR* Property;                  // Field Property:
    tComparisonOP ComparisonOp;       // Field OP:
    WCHAR* Value;                     // Field Value:
} tFindFilesPluginsStructW;

typedef struct {
    // General tab
    union {                           // Field Search in:
        WCHAR* SearchIn;
        WCHAR** SearchInArray;        // <- default valid field
    };
    union {                           // Field Search for:
        WCHAR* SearchFor;
        WCHAR** SearchForArray;       // <- default valid field
    };
    tSearchFlags SearchFlags;         // Various fields with checkboxes.
    DWORD SearchDepth;                // Field Search in subdirectories.
    WCHAR* FindText;                  // Field Find text:
    
    // Advanced tab
    FILETIME DateBetweenLowerLimit;   // Field Date between:
    FILETIME DateBetweenUpperLimit;
    FILETIME NotOlderThan;            // Field Not older than:
    DWORD64 FileSizeLowerLimit;       // Field File size:
    DWORD64 FileSizeUpperLimit;
    DWORD AttributesMask;             // Field Attributes: Mask of valid values in FindFilesStructW.Attributes.
    DWORD Attributes;                 //    Attributes, which you are looking for.
    
    // Plugins tab
    tFindFilesPluginsStructW* SearchInPlugins;
    BOOL FindAnyMatch;                // Fields FALSE = AND (all match), TRUE = OR (any match)

} tFindFilesStructW;

// Function prototypes
extern "C" __declspec(dllexport) HANDLE __stdcall FindFindFirstW(tFindFilesStructW* ffs,WIN32_FIND_DATAW *FindData);
extern "C" __declspec(dllexport) BOOL __stdcall FindFindNextW(HANDLE Hdl,WIN32_FIND_DATAW *FindData);
extern "C" __declspec(dllexport) int __stdcall FindFindClose(HANDLE Hdl);
Last edited by yrwin on 2013-10-23, 15:46 UTC, edited 1 time in total.
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Please be more specific. What kind of search do you miss? Why can't you use content plugins' fields in Plugins search tab in search to extend its possibilities?
User avatar
Lefteous
Power Member
Power Member
Posts: 9535
Joined: 2003-02-09, 01:18 UTC
Location: Germany
Contact:

Post by *Lefteous »

I guess alternate engines could mean an engine that relies on a search index. Personally I don't think it doesn't make sense to add such a plugin system. Having several search engines installed is somewhat overkill.
Just one that works great would be enough. This should be implemented internally. This could be a major feature of one of the next versions.
yrwin
Junior Member
Junior Member
Posts: 4
Joined: 2013-09-27, 15:38 UTC

Post by *yrwin »

Lefteous wrote:I guess alternate engines could mean an engine that relies on a search index. Personally I don't think it doesn't make sense to add such a plugin system. Having several search engines installed is somewhat overkill.
Just one that works great would be enough. This should be implemented internally. This could be a major feature of one of the next versions.
This is true. I mean Alt-F7 Something, which allows me to find files quickly instead of waiting minutes. There can be more search engines, each for one file type, so i dont think, it is possible to do this as build-in feature. Maybe this can be done at least for text files.
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Well, it seems that we need some kind of plugins that will:
1. Accept file name mask(s),
2. Accept search path(s),
3. Return list of matched file paths.
So TC then will only need to apply ignore list. Or maybe even ignore list may be also passed to plugin...
yrwin
Junior Member
Junior Member
Posts: 4
Joined: 2013-09-27, 15:38 UTC

Post by *yrwin »

MVV wrote:Well, it seems that we need some kind of plugins that will:
1. Accept file name mask(s),
2. Accept search path(s),
3. Return list of matched file paths.
So TC then will only need to apply ignore list. Or maybe even ignore list may be also passed to plugin...
This is true. I can add just
2.5. Optional: Accept find text or other hints what to find
User avatar
Hacker
Moderator
Moderator
Posts: 13052
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker »

Perhaps you might support the idea of an Indexed search using WDX plugins.

Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
yrwin
Junior Member
Junior Member
Posts: 4
Joined: 2013-09-27, 15:38 UTC

Post by *yrwin »

Many thanks for supporting Everything as an indexing engine! Now I miss just index of content of files :)
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6450
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Post by *Horst.Epp »

yrwin wrote:Many thanks for supporting Everything as an indexing engine! Now I miss just index of content of files :)
Content indexing is done by Windows and from the results you can enter TC.
Windows 11 Home x64 Version 23H2 (OS Build 22631.3374)
TC 11.03 x64 / x86
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.2, Listary Pro 6.3.0.69
QAP 11.6.3.2 x64
tibro1977
New Member
New Member
Posts: 1
Joined: 2021-05-28, 07:49 UTC

Re: Find Files plugins

Post by *tibro1977 »

hi, i need a plugin they do the following:
i search for with regex for emails in a whole directory.
and the results (only the emails) may save in a new file.
is it possible??
User avatar
tuska
Power Member
Power Member
Posts: 3741
Joined: 2007-05-21, 12:17 UTC

Re: Find Files plugins

Post by *tuska »

tibro1977 wrote: 2021-05-28, 07:53 UTC hi, i need a plugin they do the following:
i search for with regex for emails in a whole directory.
Hi,

Example queries using the tool 'Everything' in Total Commander (see my autosignature)
Find files --> field: "Search for:"

Code: Select all

ev:ext:eml content: regex:((http|ftp|https):\/\/)?(([\w.-]*)\.([\w]*))
ed:ext:eml content: regex:((http|ftp|https):\/\/)?(([\w.-]*)\.([\w]*))

ev:files:regex:^AW
ed:files:regex:^AW

----------------------------------------------------------------------
This does NOT work for extension 'MSG' --> content: ...
ev:ext:msg content: regex:((http|ftp|https):\/\/)?(([\w.-]*)\.([\w]*))
ed:ext:msg content: regex:((http|ftp|https):\/\/)?(([\w.-]*)\.([\w]*))
RegEx from: stackoverflow.com - Regular expression to find URLs within a string
 
tibro1977 wrote: 2021-05-28, 07:53 UTC... and the results (only the emails) may save in a new file.
is it possible??
I don't know, especially where the file format (.eml, .msg) is unknown.

Have you googled this topic yet?
There is a little bit written about email merging...

Creating a ZIP file is not an option?


Windows 10 Pro (x64) Version 21H1 (OS build 19043.1023)
TC 10.00RC2 x64/x86 | 'Everything' 1.5.0.1262a (x64)
Search queries: TC <=> 'Everything' | 'Everything' 1.4.1.1009 (x64)
Post Reply