Live data from Hacker News

Watchman: Execute a command when something changes

github.com

1–10 of 98 posts

Re: Watchman: Execute a command when something changes

#3
Not 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 use more inotify slots.

3. Denounces / waits for changes to settle

4. Client libraries in a few different languages for scripting purposes

https://facebook.github.io/watchman/

Re: Watchman: Execute a command when something changes

#7
post #6

What 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

#8
post #7
post #6

What 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]

You are confused about how the tool works. This project uses inotifywait from inotify tools to reimplement what inotifywait already does. The linked article page at github clearly says this.

Adding a new layer atop inotify tools doesn't make that package automatically run on new platforms. There are already tools on macos that use the native FSEvents API for watching for file changes and executing scripts.

Re: Watchman: Execute a command when something changes

#10
post #7
post #6

What 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]

This wraps inotifywait, so it doesn’t really address cross-platform needs.

The unique features in this over straight inotifywait is plugging together the command you want to execute, and some event dedupe logic. Grand majority of the code is around colorized logs, command docs, and some options handling code which mostly just gets piped to inotifywait.

Post reply on HN