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…
Watchman: Execute a command when something changes
21–30 of 98 posts
Re: Watchman: Execute a command when something changes
#22There are other much more popular tools that do the same thing, like entr, watchexec, and nodemon. Why is this posted?
Re: Watchman: Execute a command when something changes
#23It’s been a few years, so perhaps it got addressed, but this library used to introduce a “memory leak” by design, by infinity storing pointers to files being watched.
It was a pain to isolate (https://techtldr.com/simple-guide-to-finding-a-javascript-me...)
Ultimately I ended up fixing it by writing my own version using native system calls available on Node.
The moral of the story, this library is great if you are building cross platform dev tool. It is not (at least wasn’t at the time) great for long lived processes that target only one type of operating system.
Re: Watchman: Execute a command when something changes
#24Re: Watchman: Execute a command when something changes
#25Not 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…
https://pypi.org/project/watchdog/
https://github.com/gorakhargosh/watchdog
EDIT: Now I'm wondering how often I miss out on something because I confuse it for something I already use. Maybe there is room for a "things I use" or "things I know about" browser plugin.
Re: Watchman: Execute a command when something changes
#26Earlier quoted context omitted.
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]
Discovered fswatch recently, it's proved very useful, my favorite use being replacing a few situations where I was using sshfs with fswatch+rsync: no network lag on save/load, can even work offline, but everything still makes its way to the network destination!
Re: Watchman: Execute a command when something changes
#27However, this is a single bash script, which definitely could be stable and forgotten about. Something like this would be more appealing as a posix shell script, but if you're using bash anyway and not trying to distribute, then stable and simple goes a long way.
Re: Watchman: Execute a command when something changes
#28Re: Watchman: Execute a command when something changes
#29Re: Watchman: Execute a command when something changes
#30this project hasn't had a commit in 8 years and only has a handful of stars. It confusingly shares the name with a much more popular tool from Meta—though the use case is slightly different. There are other much more popular tools that do the same thing, like entr, watchexec, and nodemon. Why is this posted?