zig
zig copied to clipboard
Watch.zig: Extract File System Watching into Standard Library
When Watch.zig matures with more supported platforms, it would be useful to have that logic extracted out into a standard library API for directory watching. Something like std.fs.Dir.Watch
For context, something like this did exist previously:
https://github.com/ziglang/zig/blob/8d11ade6a769fe498ed20cdb4f80c6acf4ca91de/lib/std/fs/watch.zig
but it bitrotted since it wasn't used internally and was eventually removed in https://github.com/ziglang/zig/pull/18712
There is also the Bun file watcher implementation: https://github.com/oven-sh/bun/blob/main/src/Watcher.zig