I’m going to include fsniper today, even though I am tempted to drop it into my list of nonworking or possibly out-of-date software.
I’ve known a about fsniper for a long time, but I’ve rarely had the occasion to use it. In principle, it’s quite simple. fsniper watches a directory, and if anything changes in that folder, fsniper executes a command.
We’ve seen this idea in action before, with entr. No doubt there are other applications that do much the same thing.
fsniper has some configuration to set up before it will do its job though. It’s much more finicky than entr, but the tradeoff is that it is much more flexible too.
fsniper can screen events by file type, by mime type or even just by the name of the file. And it can handle multiple options within the same folder, or report errors.
So conceivably you could set up fsniper to watch a folder, and any time a code file changes, it automatically triggers the compiler. If the compiler ends with an error, fsniper knows to trigger a second command — maybe an error report or send a bell to the terminal.
I’m just imagining here. The problem is, and the reason I don’t have a screenshot, that I had some difficulty getting fsniper to do what it promised.
I had configuration files and the program installed and ran fine, but wouldn’t “do” anything when there was a change. More than likely I had it set up wrong. That happens quite often.
And I could see in the log file that fsniper was catching the change, triggering the command, but nothing would appear on my screen. Hmm. 😕
My only other misgiving about fsniper is that the home page was unresponsive for me. The download link still works, but it always makes me twitchy when a home page 403s … or just doesn’t show.
Be that as it may, I’m 99 percent sure fsniper works. But if you mis-configure it like I probably did, you might not get that last 1 percent going. Such is life. 😐
Pingback: ftp: The classic, in action | Inconsolation
I usually just put an `inotifywait -e ACCESS -e CLOSE_WRITE` in a while loop. It’s cumbersome enough that it always ends up in a script rather than a one liner though.
Pingback: watchfile.sh: Perhaps the best thus far | Inconsolation
Pingback: wendy: Under wendy’s watchful eye | Inconsolation
Pingback: inotifywait, inotifywatch and incron: A package deal | Inconsolation