Complex Filters (Inclusion/Exclusion) - What would I be wrong?

Get help for specific problems
Posts: 2
Joined: 11 Mar 2025

RogerioPrevedel

First, I would like to praise FFS a lot, an advanced technology, simple and friendly interface and very efficient and fast response (albeit faster on Windows than on Linux). Congratulations to the creators and maintainers!

Now, specifically about complex filters:

Through the FFS online manual, we have the "Exclude Files" button, where we are briefly explained, in a single frame, the combinations of reference to folders and files, where I noticed some gaps and inconsistencies, especially in the interpretation of each file filter example.

However, after numerous tests, I faced a problem of a complex filter, particular, as explained below:

Objective:

Consider for the filter (F7) the following file groups:

Given the following constitution of folders and files, from comparison folder pair folder, for example:

Situation A:

/file1.ext1
/file2.ext1
.
.
.
/file-x.ext1
/file1.ext2
/folder1/flex1.ext1
/folder1/folder11/folder111/flex2.ext1
/folder1/folder11/folder112/folder1121/flex3.ext1
/folder1/folder11/folder112/folder1121/file2.ext2
/folder2/folder21/folder211/folder2111/folder21111/flex4.ext1
/folder3/flex5.ext1

My goal is to include in comparison the following files:

- All files with extension .ext1 of my main folder, the comparison folder pair paste, and only of this folder (no other): "/*.ext1"

- The "file2.ext2" specific file of "folder1121" from path "folder/folder1/folder11/folder112/folder1121/"

Intuitively, I would inform the inclusion of this group of files above, in the "Include" of the filter:

/*.ext*
/folder1/folder11/folder112/folder1121/file2.ext2

Simple as that!

But as the FFS considers the 'include' above:

1 - Consider the second line of (my) "Include" as redundant above;
2 - Considers that the first line of my 'Include' above would strictly encompass the entire constitution of "situation A", like this:

/file1.ext1
/file2.ext1
.
.
.
/file-x.ext1
/file1.ext2
/folder1/flex1.ext1
/folder1/folder11/folder111/flex2.ext1
/folder1/folder11/folder112/folder1121/flex3.ext1
/folder1/folder11/folder112/folder1121/file2.ext2
/folder2/folder21/folder211/folder2111/folder21111/flex4.ext1
/folder3/flex5.ext1

Otherwise, the FFS considers that, to meet my goal, explained above, according to my understanding, (which is not clear in the online manual initially mentioned), I would have to create 2 pairs of folders, with the same paths, on the left and right side, like this:

1st pair of folders:

Include:

/*.ext*

Exclude:

/*/

2nd pair of folders:

Include:

/folder1/folder11/folder112/folder1121/file2.ext2

Exclude:

(Empty area)

Reason found, by pure deduction or logic:

The FFS considers that every set of files represented in "Include" (and "Exclude"), for example, by "/folderx/*.ext*" does not only represent files from the "/folderx" folder, but from "folderx" folder and all sub folders from "/folderx". And on the other hand, it does not have any simpler and more objective solution to make this same representation in a single pair of folders.

So I see myself back up my configuration files (".cfg", ".conf", ".json", ".xml", ".ini", ".config", etc.) of all my dozens of programs installed on Windows, for example, contained in the folders "C:\ProgramData", "C:\Users\(user)\Appdata\Local\.." and "C:\Users\(user)\Appdata\Roaming\..", I found a huge problem, forcing me to perform this backup, in FFS, through various pairs of identical folders, but with different filters.

I correctly concluded this FFS's impossibility and complexity, or would it be interpreting and misunderstood the construction of these filters?

If I am missing, what would be the solution to a single folder file set represented by the border characters like '*' and '?', Without FFS to consider generalizing the entire existing sub folders set?

Hoping that I really be wrong and there is a simpler and more comprehensive solution.

Very grateful!
User avatar
Site Admin
Posts: 7348
Joined: 9 Dec 2007

Zenju

User avatar
Posts: 2607
Joined: 22 Aug 2012

Plerry

Your post is quite lengthy,
but if I understand your first part correctly, you should have an
Include Filter of
/*.ext1 ( so: not /*ext* )
/folder1/folder11/folder112/folder1121/file2.ext2
and an Exclude Filter of
/*/*.ext1

Your initial include rule /*.ext* includes not only all *.ext1 files, but also e.g. all *.ext2 files, due to the wildcard * behind .ext. Then your second line is redundant, because that specific file2.ext2 file is already included by your first rule.
The modified first Include rule of /*.ext1 will now only include all *.ext1 files, so not the file2.ext2 file of your second Include rule, which is now no longer redundant.

As you also concluded yourself, the * wildcard is eager, and includes the forward slash "/".
The include rule /*.ext1 does therefore include all *.ext1 files, not just the ones in the root of you base locations. To overcome that for your use case, the added Exclude rule /*/*.ext1 excludes all *.ext1 files in any of the subdirectories of the base location, but not the *.ext1 files in the root of the base locations.