14 ms·
This command seems like a no-brainer that should be in all OSes by default. It's mind-boggling that most systems don't have a standard tool for observing file
by BrainVirus 4y ago
This command seems like a no-brainer that should be in all OSes by default.
It's mind-boggling that most systems don't have a standard tool for observing file changes. The only language I know of that has a platform-agnostic API for this is Factor.
- dspillett 4y agoThe required kernel hooks exist in pretty much any common OS these days, it is a user-space tool that is sometimes missing. It may not be installed by default, but inotifywait is available in common Linux distributions, usually in a package called something like ionotify-tools, and has been for over a decade-ana-half IIRC. It'll work under WSL on Windows too, though only for ext4 devices not bits of the Windows filesystem made available to Linux. I can't speak to what other OSs include by default, but as every major OS has a different API for how to register a listener & how it gets messages no built-in tool is going to be cross-platform. There are third party tools which present more cross-platform consistency, most notably https://github.com/emcrisostomo/fswatch#readme https://github.com/emcrisostomo/fswatch#readme (also available in common Linux distros, just an apt install away in Debian for instance).