matches_filters

Function matches_filters 

Source
pub(crate) fn matches_filters(
    _path: &Path,
    metadata: &Metadata,
    opts: &Options,
) -> bool
Expand description

Test a directory entry’s metadata against all active filters.

This function checks the entry’s type, size, modification time, permissions, owner, and group against the corresponding filter in Options. If any active filter fails, returns false; otherwise returns true.

§Arguments

  • _path — the filesystem path (currently unused but available for future use)
  • metadata — the std::fs::Metadata for the entry (may be symlink or resolved)
  • opts — the runtime options containing all filter configurations

§Filter evaluation order

  1. Type filter (-t)
  2. Size filter (-s) — only applies to regular files
  3. Modification time filter (-m)
  4. Permission filter (-p) — compares mode & 0o7777 against octal target
  5. User filter (-u) — looks up UID → username via getpwuid()
  6. Group filter (-g) — looks up GID → group name via getgrgid()