About

Metadata

  • Last updated , by muzzle
  • License LGPL-3.0-only
  • Maintained by: christof.schramm@campus.lmu.de

  • Lottery factor: 0

Links

Installation

Package Flags

Use the -f option with cabal commands to enable flags

    build_fs_events (on by default)

    Build in FSEvents support (OS X)

Readme

Delta is a library for detecting file changes in any given directory. The package is written using the sodium FRP library but it also provides a callback based API.

File changes on OS X are based on the FSEvents API that is also used by TimeMachine. On other operating systems the library currently uses recursive descents in directories. I will include inotify for Linux. If someone would like to have a non-polling based API for windows or BSD, I would really like it if anyone would contribute.

The project also contains an executable, delta-run, which allows you to run arbitrary shell commands when a file in a directory (recursively) changes.

$> delta-run --help
Usage: delta-run [-i|--interval INTERVAL] [-v|--verbose] FILE CMD
Available options:
-h,--help                Show this help text
-i,--interval INTERVAL   Run at most every n seconds
-v,--verbose             Print extra output
FILE                     The directory that is watched
CMD                      The command to run

For example you could use delta-run to rebuild your project everytime the source changes like this:

delta-run ./src "cabal build"