haskell-fswatch / hfsnotify

Unified Haskell interface for basic file system notifications
BSD 3-Clause "New" or "Revised" License
136 stars 40 forks source link

Use polling as a generic fallback #110

Open amesgen opened 1 year ago

amesgen commented 1 year ago

Right now, using polling as a fallback if no native watcher is available is only done for BSDs, but I think there is no reason to not simply extend this fallback to all platforms other than Linux, macOS and Windows.

As a motivating example, the WASI target (see the upcoming GHC WASM backend does not provide a native file watching interface. With this patch, fsnotify compiles just fine on that backend.

thomasjm commented 1 year ago

As a motivating example, the WASI target (see the upcoming GHC WASM backend does provide a native file watching interface.

You mean it doesn't ?

This seems good to me, we just have to be a careful not to break *BSD since we don't test those in CI.