Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You can get inotify-or-equivalent support in Go for specific OSes reasonable well with bindings (simple enough even to write your own if push came to shove), what's missing is a cross-platform, simple API. Which, arguably, is because it turns out that despite the problem sounding simple, a cross-platform, simple API is all but impossible. You can sort of get one for a single file or a single small directory with no recursive subdirectories, but beyond that, you're surprisingly boned.

This hasn't got much, if anything, to do with Go specifically; in particular, I've been aware of everything I write in this post since before I was even aware of Go. The OS support is just too variable and shot through with subtle-yet-critically-important semantic differences, in addition to the fact the problem is harder than it looks at first. Trying to write a lowest-common-denominator API leaves you with a really low LCD. Trying to write a higher level API that offers the more convenient stuff leaves you with an API that makes it trivially easy to write something that works really, really well on one platform and is completely non-performant on another (in particular, trying to automatically "recurse" on the directories). It turns out there's no happy middle here for the general case.



Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: