_.-----._
.'.-'''''-.'._
//`.:#:' `\\\ __ ___
;; ' ;;'.__.===============, | |--.-----.' _|.--------.
|| || __ ) | <| _ | _|| |
;; ;;.' '===============' |__|__|__ |__| |__|__|__|
\\ /// |__|
jgs ':.._____..:'~
`'-----'`
kqfm
takes a list of paths on stdin
and monitors them for changes using kqueue(1)
, outputting those changes to stdout
.
kqfm
has no dependencies. It only works on platforms where kqueue(1)
is available, such as Mac OS X, FreeBSD, NetBSD, OpenBSD, and DragonflyBSD.
Get the source and run make install
. A Homebrew recipe for OS X is forthcoming.
Watch a directory of .md
files for writes, and output a listing when a file is written to.
find doc -name '*.md' | kqfm -e write | while read path changes; do ls -la $path; done
Watch a single file and run a command when it changes in any way.
echo "file.c" | kqfm | while read changes; do make; done
The man page contains some more usage information.
I wrote this to scratch my own itch, which was for something with no dependencies that operates with plain old text, and leaves things like executing commands to other programs.
guard and wach both already exist, and may suit your needs better than this. Check them out too.
Gabriel Gironda, 2012. See LICENSE for license details.