automata/fsevent/diff

Values

pub fn diff(
  prev prev: snapshot.Snapshot,
  curr curr: snapshot.Snapshot,
  watch watch: watch.Watch,
) -> List(event.WatchEvent)

Compute the events emitted when prev is replaced by curr under the subscription described by watch.

The result list is sorted by canonical path so the output is deterministic across the BEAM and JavaScript targets.

Rename detection: when the same file_id is observed at two different paths across prev and curr and the disappearance and appearance pair up one-to-one, the differ folds the would-be Remove (at the old path) and Create (at the new path) into a single Rename event whose renamed_from carries the old path. If no file_id is available, or the pairing is ambiguous, the rename is reported as a Remove/Create pair instead.

Search Document