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

Safe HaskellSafe
LanguageHaskell98

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

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

Stop a watcher from watching.

data EventType

The type of file change that occurred.

Constructors

Changed 
Created 
Deleted 

Instances

data Watcher

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