Skip to content

watch for filesystem changes and execute commands

Notifications You must be signed in to change notification settings

mmailhos/filewatch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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.

Releases

No releases published

Packages

No packages published