|
fswatch 1.21.0
|
A path filter (fsw::monitor_filter) can be used to filter event paths. A filter type (fsw_filter_type) determines whether the filter regular expression is used to include and exclude paths from the list of the events processed by the library. By default, libfswatch uses the legacy filter mode and processes filters this way:
Said another way:
The filter mode can be set to filter_mode_conjunctive to evaluate filters as a conjunction:
Said another way, conjunctive mode accepts paths matching:
(no includes OR matches include) AND NOT matches exclude
Prune filters are separate from path filters. A prune filter is a regular expression used by recursive monitors to decide whether traversal should descend into a non-root directory. When a directory is pruned, that directory's descendants are not scanned or monitored by implementations that traverse directory trees.
Pruning is applied before normal event filtering and is intentionally opt-in: unlike exclusion filters, prune filters can make included descendants impossible to observe.
Root paths are not pruned, even if they match a prune filter, because those paths were explicitly supplied by the caller.