Detecting file changes on macOS with kqueue
Summary
This article explores detecting file changes on macOS using the kqueue API, including a Go-based watcher and a C example. It covers kqueue data structures, watching named files and directories, implementing in Go with per-file descriptors, and notes on limitations such as potential descriptor leakage and scalability concerns. A practical guide for building lightweight, event-driven file watchers on macOS with real code samples.