Filewatch looks for modifications in the given files and executes the custom command. It uses the inotify
Linux kernel API to trigger commands based on filesystem notifications (e.g. not POSIX).
Usage: filewatch [-m single|concurrent|override] files... command
-m
mode is defining the behavior of the program regarding launched commands.
It can be one of those three:
s|single
: one command is running at a time and is blockingc|concurrent
: multiple commands can be running at the same timeo|override
: latest command takes over the existing one
Educational project around C Linux programming to play with inotify, signalfd/sigaction, fork/exec, poll and other sys calls. I am not using system for this purpose and hence, the command is not interpreted in a shell. Static code and memory analysis were performed with Valgrind and Clang scan-build but issues, PR and code review are completely welcome. If you like in this project, you may find inotifywait(1) and fswatch interesting.