fswatch 1.17.1
Path Filtering

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. libfswatch processes filters this way:

  • If a path matches an including filter, the path is accepted no matter any other filter.
  • If a path matches an excluding filter, the path is rejected.
  • If a path matches no lters, the path is accepted.

Said another way:

  • All paths are accepted by default, unless an exclusion filter says otherwise.
  • Inclusion filters may override any other exclusion filter.
  • The order in the filter definition has no effect.