hiernotify-2011.4.12: Notification library for a filesystem hierarchy.

System.Hiernotify.Polling

Synopsis

Documentation

mkPollNotifierSource

Arguments

:: Int

minimum lapse between polling actions

-> Configuration

notifier configuration

-> IO Notifier

the polling notifier

make a polling notifier , given an interval in seconds

data Configuration Source

Configuration for notifiers. Minimal configuration to build a notifier.

Constructors

Configuration 

Fields

top :: FilePath

directory at the top of the hierarchy under control

silence :: Int64

minimum time lapse in seconds where nothing changes before a difference is released

select :: FilePath -> Bool

filter for file paths, positive must be included

data DifferenceP a Source

Difference datatype containing a difference as three sets of paths. This datatype is the core content of a notification of changes in a hierarchy.

Constructors

DifferenceP 

Fields

created :: [a]

Files appeared

deleted :: [a]

Files disappeared

modified :: [a]

Files modified

Instances

data Notifier Source

Abstract notifiers. A Notifier is an object controlling a hierarchy.

Its difference method will block until a Difference is available and at least a time of peace has elapsed.

Reading a difference must result internally in deleting the difference and updating the list of paths. The list of paths read together with the difference is always the list of paths to which the difference will be applied.

Constructors

Notifier 

Fields

difference :: IO (Difference, [FilePath])

block until next difference

stop :: IO ()

stop the notification daemon