Watchman: Execute a command when something changes
11–20 of 98 posts
Re: Watchman: Execute a command when something changes
#12Do not use if your life depends on it.
Re: Watchman: Execute a command when something changes
#13What does this add to inotifywait? That does exactly the same as this project, which uses inotifywait to reimplement inotifywait. For example: dnf install inotify-tools or apt-get install inotify-tools
ifnotifywait doesn't exist on macOS, so in addition to that not being an option on macos, this would be something you could write tools that a team who used multiple platforms, or a person with setups on multiple os's, could use. I suspect this might even be usable on windows. [edit: fswatch looks very promising, and may be a better choice than either ifnotifywait or watchman]
Re: Watchman: Execute a command when something changes
#14Re: Watchman: Execute a command when something changes
#15Not to be confused with Facebook’s file watch daemon, also names watchman, which does the same sort of thing but is more complicated. There’s a bunch of tools that integrate Facebook’s watchman for more efficient change tracking. Advantages of Facebook’s watchman: 1. Implements efficient file system event watches on macOS and Windows 2. IPC/daemon system reduces resource use because overlapping watches/triggers don’t…
Re: Watchman: Execute a command when something changes
#16This 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.
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 (also available in common Linux distros, just an apt install away in Debian for instance).
Re: Watchman: Execute a command when something changes
#17From my experience, these types of notification handlers are very fragile and tend to fail every so often. Do not use if your life depends on it.
Re: Watchman: Execute a command when something changes
#18From my experience, these types of notification handlers are very fragile and tend to fail every so often. Do not use if your life depends on it.
From my experience, they break every time if you are making changes with tools that replace the file rather than change it in-place, like most text editors.
Re: Watchman: Execute a command when something changes
#19I've seen about a dozen versions of this now. So my question is, who watches the watchmen?
Re: Watchman: Execute a command when something changes
#20[0] - https://www.man7.org/linux/man-pages/man1/inotifywait.1.html