Skip to content

watch

Watches files or directory trees for changes (FSEvents).

<watch ... />

Overview

callback(events) receives batches of {path, id, created, removed, renamed, modified, directory, rescan, historyDone}. Options: since, an event ID from AppKit.latestEventId() to replay what changed after it, and latency in seconds. Returns a handle whose cancel() stops the watch; the current Scope cancels it when disposed, so a watch lives as long as the window or controller that made it.

Platform notes

  • AppKit FSEvents. UIKit does not support file system watching.

Source: lua/embedded/AppKit.lua:2673 (AppKit.watch)