hinotify-0.4.2: Haskell binding to inotify

Copyright | (c) Lennart Kolmodin 2006-2012
License | BSD3
Maintainer | kolmodin@gmail.com
Stability | experimental
Portability | hc portable, linux only
Safe Haskell | Safe-Inferred
Language | Haskell2010

System.INotify

Description

A Haskell binding to INotify. See http://www.kernel.org/pub/linux/kernel/people/rml/inotify/ and `man inotify`.

Use `initINotify` to get a `INotify`, then use `addWatch` to add a watch on a file or directory. Select which events you're interested in with `EventVariety`, which corresponds to the `Event` events.

Use `removeWatch` once you don't want to watch a file any more.

# Documentation

initINotify :: IO INotify Source #

killINotify :: INotify -> IO () Source #

withINotify :: (INotify -> IO a) -> IO a Source #

addWatch :: INotify -> [EventVariety] -> RawFilePath -> (Event -> IO ()) -> IO WatchDescriptor Source #

removeWatch :: WatchDescriptor -> IO () Source #

data INotify Source #

#### Instances

Instances details

Show INotify Source # |
Instance details Defined in System.INotify Methods showsPrec :: Int -> INotify -> ShowS Source # show :: INotify -> String Source # showList :: [INotify] -> ShowS Source #
Eq INotify Source # |
Instance details Defined in System.INotify Methods (==) :: INotify -> INotify -> Bool Source # (/=) :: INotify -> INotify -> Bool Source #

data WatchDescriptor Source #

#### Instances

Instances details

Show WatchDescriptor Source # |
Instance details Defined in System.INotify Methods showsPrec :: Int -> WatchDescriptor -> ShowS Source # show :: WatchDescriptor -> String Source # showList :: [WatchDescriptor] -> ShowS Source #
Eq WatchDescriptor Source # |
Instance details Defined in System.INotify Methods (==) :: WatchDescriptor -> WatchDescriptor -> Bool Source # (/=) :: WatchDescriptor -> WatchDescriptor -> Bool Source #

data Event Source #

Constructors

Accessed | A file was accessed. `Accessed isDirectory file`

Fields

- isDirectory :: Bool
- maybeFilePath :: Maybe RawFilePath

Modified | A file was modified. `Modified isDirectory file`

Fields

- isDirectory :: Bool
- maybeFilePath :: Maybe RawFilePath

Attributes | A files attributes where changed. `Attributes isDirectory file`

Fields

- isDirectory :: Bool
- maybeFilePath :: Maybe RawFilePath

Closed | A file was closed. `Closed isDirectory file wasWriteable`

Fields

- isDirectory :: Bool
- maybeFilePath :: Maybe RawFilePath
- wasWriteable :: Bool

Opened | A file was opened. `Opened isDirectory maybeFilePath`

Fields

- isDirectory :: Bool
- maybeFilePath :: Maybe RawFilePath

MovedOut | A file was moved away from the watched dir. `MovedFrom isDirectory from cookie`

Fields

- isDirectory :: Bool
- filePath :: RawFilePath
- moveCookie :: Cookie

MovedIn | A file was moved into the watched dir. `MovedTo isDirectory to cookie`

Fields

- isDirectory :: Bool
- filePath :: RawFilePath
- moveCookie :: Cookie

MovedSelf | The watched file was moved. `MovedSelf isDirectory`

Fields

- isDirectory :: Bool

Created | A file was created. `Created isDirectory file`

Fields

- isDirectory :: Bool
- filePath :: RawFilePath

Deleted | A file was deleted. `Deleted isDirectory file`

Fields

- isDirectory :: Bool
- filePath :: RawFilePath

DeletedSelf | The file watched was deleted.
Unmounted | The file watched was unmounted.
QOverflow | The queue overflowed.
Ignored |
Unknown FDEvent |

#### Instances

Instances details

Show Event Source # |
Instance details Defined in System.INotify Methods showsPrec :: Int -> Event -> ShowS Source # show :: Event -> String Source # showList :: [Event] -> ShowS Source #
Eq Event Source # |
Instance details Defined in System.INotify Methods (==) :: Event -> Event -> Bool Source # (/=) :: Event -> Event -> Bool Source #

data EventVariety Source #

Constructors

Access |
Modify |
Attrib |
Close |
CloseWrite |
CloseNoWrite |
Open |
Move |
MoveIn |
MoveOut |
MoveSelf |
Create |
Delete |
DeleteSelf |
OnlyDir |
NoSymlink |
MaskAdd |
OneShot |
AllEvents |

#### Instances

Instances details

Eq EventVariety Source # |
Instance details Defined in System.INotify Methods (==) :: EventVariety -> EventVariety -> Bool Source # (/=) :: EventVariety -> EventVariety -> Bool Source #

data Cookie Source #

#### Instances

Instances details

Show Cookie Source # |
Instance details Defined in System.INotify Methods showsPrec :: Int -> Cookie -> ShowS Source # show :: Cookie -> String Source # showList :: [Cookie] -> ShowS Source #
Eq Cookie Source # |
Instance details Defined in System.INotify Methods (==) :: Cookie -> Cookie -> Bool Source # (/=) :: Cookie -> Cookie -> Bool Source #
Ord Cookie Source # |
Instance details Defined in System.INotify Methods compare :: Cookie -> Cookie -> Ordering Source # (<) :: Cookie -> Cookie -> Bool Source # (<=) :: Cookie -> Cookie -> Bool Source # (>) :: Cookie -> Cookie -> Bool Source # (>=) :: Cookie -> Cookie -> Bool Source # max :: Cookie -> Cookie -> Cookie Source # min :: Cookie -> Cookie -> Cookie Source #