kqueue-0.2.1: A binding to the kqueue event library.

Safe HaskellSafe
LanguageHaskell2010

System.KQueue.HighLevel

Description

This module contains higher-level abstraction for monitoring file system changes, built on top of the bindings from System.KQueue.

Synopsis

Documentation

watchFile :: FilePath -> (EventType -> IO ()) -> IO Watcher Source #

Watch a file for changes. The file doesn't have to exist, but the directory it is in, does. Returns immediately. You can stop watching by passing the Watcher to stopWatching.

stopWatching :: Watcher -> IO () Source #

Stop a watcher from watching.

data EventType Source #

The type of file change that occurred.

Constructors

Changed 
Created 
Deleted 

data Watcher Source #

An identifier for the watcher of a file. Allows you to stop watching it later.