larzwatch
File & directory watcher.
A poll-based file and directory watcher that reports created/modified/deleted changes with fnmatch patterns, callbacks and a background thread — no native file-system hooks needed.
larzscript pkg install watch
What you get
- created/modified/deleted
- fnmatch patterns
- Callbacks & thread
- Pure poll-based
Try it
import "watch" as watch
mkdir("./watched")
let w = watch.new("./watched", "*.txt")
watch.poll(w)
write_file("./watched/a.txt", "hello")
let changes = watch.poll(w)
for c in changes { print(c["kind"], c["path"]) }Output
created ./watched/a.txt
Why it's in the Larz Stack
larzwatch is a real Larzscript package (larzscript pkg install watch) - money-native, zero dependencies, the same language as the rest of the estate, not a separate Python runtime. It composes with the rest of the Larz Stack and the Larz framework.