Detecting file changes on macOS with kqueue

A while ago I wrote a small file watcher in Go for my own use with an accompanying blog post . I needed a tool that I could just plop in front of the command I was running as part of my iteration loop. I use it for recompiling C files when I modify them, reload gcc main.c -o main && ./main and for rebuilding and reloading my static site on file changes. reload make It has two modes. If one or more…