Suggestion: Dynamic Filters

Discuss new features and functions
Posts: 25
Joined: 2 Aug 2016

CaptainStarbuck

It's tough to think of a feature that's Not in FFS for effective daily usage. Thanks Zenju!
Almost anything that's not in FFS has already been suggested. A request for dynamic processing of filters isn't new. Maybe what we need is a clear spec for how this might be implemented - simply. This proposal also addresses other requests, so this isn't *just* about filtering.

I can spend a lot of time reconfiguring filters for a lot of FFS config files. Others here have also noted the pain. The Include and Exclude filters don't allow for dynamic runtime modifications, or any common form of automation to change filters (en-masse or individually), or to change them on a per-run basis without saving.

Proposal 1: Consider a placeholder/macro like %FILTER-filename%.

The named file (maybe later allow this itself to be a macro, is read. I suggest initially that the file must conform to the `<FreeFileSync>` XML schema. All Items of that file's Include or Exclude list will be copied into the current list (not replace the current list).

Proposal 2: A pre-compare hook that runs any CLI.

This proposal (certainly not new) can be used to modify the XML config in any way, any fields, based on current conditions. With this, we don't need the other options - this this would be the canonical approach for this and many other applications.

• FFS saves the current (maybe unsaved) config file into a defined /tmp|\Temp folder.
• That filename is passed to the CLI.
• Whatever the CLI executes, it uses that filename for input, modifies the config, and saves it back to the same file (or a defined version of that file to avoid transient locks).
• FFS reads and uses the new config file, which is not saved, it's only in memory.

Proposal 3: DIY / Public FOSS Solutions / No change to FFS

I already have code that will merge filters using Proposal 1. I'll be happy to share it. I need to clean it up and post to GitHub. I wonder how many other people have their own solutions for challenges like this. Is there a common place to put them? Here in this forum? Meh...

What do YOU think?
1?
2?
3?
Your suggestion?
"I don't get it?"
"You talk too much?"

Thanks! :)
Posts: 25
Joined: 2 Aug 2016

CaptainStarbuck

I took on the challenge of extending my own filter code (Proposal 3 above) and will FOSS it when I'm happy with all v1.0 functionality.

DYFI : "ffs_dynamic_filters.js" basic features include:
- `FILTER BEGIN name` / `FILTER END name` pairs in a .ffs_gui or .ffs_batch file cause the named set of filters to be imported by DYFI into the current config file for include or exclude. Examples of filter lists includes os folders, development files, temp files/folders, etc.
- Just re-run DYFI to reset any one or more config files with the current options. Example: Add "/temp_/" to the list of temp folders (temp.ffs_filters), run DYFI, and all configs that use that config adjust with the one command - no need to go into each config.
- Can used saved lists of config files (*.ffs_config_list) and filters (*.ffs_filter_list).
- Filter lists can be nested - will not recurse/duplicate.
- Default folders and other settings defined in .env.
- README and code comments provide full documentation and examples.

More features being added now. For example, today I'm adding the abilit to an existing .ffs_gui or .ffs_batch as a template to import include/exclude filters.

Have suggestions for Dynamic Filters? Post here and I might get it into DYFI v1.0.

@Zenju - Thoughts?
Posts: 2
Joined: 11 Nov 2025

ThomasDD

Hi, I just entered forum for exactly the question of filter, so it's nice that you are alreday tuned to it. ;)

I was looking for a way to exlude files according to combinations of attributes and make exclusions from exclusions and from what I found this is not possible yet.
Example: I've got a PC and a Notebook and I use both for 3D-printing and ED-Modelling and syncronise the belonging folder via a NAS. Sometimes I am forced to export stl-files for printing and they can become pretty big. The Notebook I use usually from out of my home network and thus have limited bandwith. So the filter now excludes *.stl, but what I really need was:

Exclude *.stl if >50MB and if not *[String].stl

The cherry on the whip would be to exclude those file only if not connected to my home WLAN. ;)

Thank you very much for your efforts. FFS is very nice tool.

Thomas
User avatar
Posts: 4866
Joined: 11 Jun 2019

xCSxXenon

but what I really need was:

Exclude *.stl if >50MB and if not *[String].stl

Thomas ThomasDD, 11 Nov 2025, 10:19
You can do this! FFS filters allow you to specify size. You create a second pair of folders and set them equal to the first pair, exclude *.stl from the 'main' pair, change the inclusion filter to only cover stl files, and set the size restraints accordingly.
Beautiful? no
Functional? yes

It would be slick to parse each filter line for additional 'parameters', such as those exposed by Windows (size, height, width, framerate, etc). Sounds like a large code rework though and the text boxes are likely small enough to cause confusing overflow
Posts: 2
Joined: 11 Nov 2025

ThomasDD

Thanks. Not beautiful but functional ;)