System.INotify

hinotify-0.3.9: 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
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 #

killINotify :: INotify -> IO () #

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

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

removeWatch :: WatchDescriptor -> IO () #

data INotify #

Instances

Eq INotify # |
Methods (==) :: INotify -> INotify -> Bool # (/=) :: INotify -> INotify -> Bool #
Show INotify # |
Methods showsPrec :: Int -> INotify -> ShowS # show :: INotify -> String # showList :: [INotify] -> ShowS #

data WatchDescriptor #

Instances

Eq WatchDescriptor # |
Methods (==) :: WatchDescriptor -> WatchDescriptor -> Bool # (/=) :: WatchDescriptor -> WatchDescriptor -> Bool #
Show WatchDescriptor # |
Methods showsPrec :: Int -> WatchDescriptor -> ShowS # show :: WatchDescriptor -> String # showList :: [WatchDescriptor] -> ShowS #

data Event #

Constructors

Accessed | A file was accessed. `Accessed isDirectory file`
Fields isDirectory :: Bool maybeFilePath :: Maybe FilePath
Modified | A file was modified. `Modified isDirectory file`
Fields isDirectory :: Bool maybeFilePath :: Maybe FilePath
Attributes | A files attributes where changed. `Attributes isDirectory file`
Fields isDirectory :: Bool maybeFilePath :: Maybe FilePath
Closed | A file was closed. `Closed isDirectory file wasWriteable`
Fields isDirectory :: Bool maybeFilePath :: Maybe FilePath wasWriteable :: Bool
Opened | A file was opened. `Opened isDirectory maybeFilePath`
Fields isDirectory :: Bool maybeFilePath :: Maybe FilePath
MovedOut | A file was moved away from the watched dir. `MovedFrom isDirectory from cookie`
Fields isDirectory :: Bool filePath :: FilePath moveCookie :: Cookie
MovedIn | A file was moved into the watched dir. `MovedTo isDirectory to cookie`
Fields isDirectory :: Bool filePath :: FilePath 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 :: FilePath
Deleted | A file was deleted. `Deleted isDirectory file`
Fields isDirectory :: Bool filePath :: FilePath
DeletedSelf | The file watched was deleted.
Unmounted | The file watched was unmounted.
QOverflow | The queue overflowed.
Ignored |
Unknown FDEvent |

Instances

Eq Event # |
Methods (==) :: Event -> Event -> Bool # (/=) :: Event -> Event -> Bool #
Show Event # |
Methods showsPrec :: Int -> Event -> ShowS # show :: Event -> String # showList :: [Event] -> ShowS #

data EventVariety #

Constructors

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

Instances

Eq EventVariety # |
Methods (==) :: EventVariety -> EventVariety -> Bool # (/=) :: EventVariety -> EventVariety -> Bool #

data Cookie #

Instances

Eq Cookie # |
Methods (==) :: Cookie -> Cookie -> Bool # (/=) :: Cookie -> Cookie -> Bool #
Ord Cookie # |
Methods compare :: Cookie -> Cookie -> Ordering # (<) :: Cookie -> Cookie -> Bool # (<=) :: Cookie -> Cookie -> Bool # (>) :: Cookie -> Cookie -> Bool # (>=) :: Cookie -> Cookie -> Bool # max :: Cookie -> Cookie -> Cookie # min :: Cookie -> Cookie -> Cookie #
Show Cookie # |
Methods showsPrec :: Int -> Cookie -> ShowS # show :: Cookie -> String # showList :: [Cookie] -> ShowS #