mmailhos / filewatch

watch for filesystem changes and execute commands

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Filewatch

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).

Synopsis

  Usage: filewatch [-m single|concurrent|override] files... command

Options

-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 blocking
  • c|concurrent: multiple commands can be running at the same time
  • o|override: latest command takes over the existing one

Description

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.

About

watch for filesystem changes and execute commands


Languages

Language:C 96.9%Language:Makefile 3.1%