Hasty Briefsbeta

Bilingual

Show HN: Mustardwatch: Detect what files a program uses, rerun when they change

a year ago
  • #linux
  • #command-line-tool
  • #file-monitoring
  • mustardwatch is a tool that runs a command, traces it to detect files it uses or might use, and watches those files for changes to rerun the command upon changes.
  • It is implemented using the Linux ptrace API (similar to strace) and currently only supports x86-64 Linux.
  • Usage: `mustardwatch [OPTION...] COMMAND [ARG...]`
  • Key features include tracking files used by subprocesses (though subprocesses are killed when the main process exits) and skipping files in common global directories by default.
  • Options include clearing the screen before running the program (`-c`), watching directories (`-d`), not skipping global files (`-g`), outputting watched files to a file (`-o`), and verbose output (`-v`).
  • For more details, refer to the comments in `mustardwatch.c`.