system-inotify-0.1: Binding to Linux's inotify interface

System.Inotify

Description

This module wraps Linux's inotify interface for directory change notification. This Haddock doesn't provide full documentation about the semantics of this system. For that you should read the manual pages for inotify which can be found at http://linux.die.net/man/7/inotify

Synopsis

Documentation

data ChangeEvent Source

These are the events which can be observed

Constructors

Accessed 
Modified 
AttributeModified 
WritableClosed

writable file was closed

Closed

non writable file was closed

Opened 
MovedFrom 
MovedTo 
SelfMoved

the watched directory/file was moved

Created 
Deleted

subfile was deleted

SelfDeleted

the watch directory/file was deleted

data Option Source

When registering a watch, you can also give a number of options

Constructors

DontFollow

don't dereference target if it's a symbolic link

MaskAdd

Add events to a watch if that given path is already being watched

Oneshot

Monitor for one event only

OnlyDir

Only watch if the target is a directory

data Alert Source

The kernel can also report one of these alerts

Constructors

Ignored

watch was implicitly removed

QueueOverflowed 
Unmounted 

Instances

data Event Source

These are the events which the kernel reports back to us.

Constructors

Event 

Instances

data Watch Source

Instances

inotify :: IO InotifySource

Create a new Inotify object. Each inotify object has its own stream of events which can be read and it's own Watch namespace (so n.b. that Watch objects from different Inotify's can compare equal).

addWatch :: Inotify -> FilePath -> [ChangeEvent] -> [Option] -> IO WatchSource

Add a watch on a file or directory

next :: Inotify -> IO EventSource

Read the next event from an Inotify

allChangeEvents :: [ChangeEvent]Source

A list containing all change events