The hinotify package

[Tags: bsd3, library]

This library provides a wrapper to the Linux Kernel's inotify feature, allowing applications to subscribe to notifications when a file is accessed or modified.


[Skip to ReadMe]

Properties

Versions0.1, 0.2, 0.3, 0.3.1, 0.3.2, 0.3.3, 0.3.4, 0.3.5, 0.3.6, 0.3.7, 0.3.8, 0.3.8.1
Change logNone available
Dependenciesbase (<3 || >=4.5.0.0 && <5), containers, directory, unix [details]
LicenseBSD3
AuthorLennart Kolmodin
MaintainerLennart Kolmodin <kolmodin@gmail.com>
CategorySystem
Home pagehttps://github.com/kolmodin/hinotify.git
Source repositoryhead: git clone git://github.com/kolmodin/hinotify.git
UploadedSun Apr 27 14:08:56 UTC 2014 by LennartKolmodin
DistributionsDebian:0.3.8.1, Fedora:0.3.7, FreeBSD:0.3.8.1, LTSHaskell:0.3.8.1, NixOS:0.3.8.1, Stackage:0.3.8.1
Downloads26186 total (747 in last 30 days)
Votes
0 []
StatusDocs available [build log]
Successful builds reported [all 1 reports]

Modules

[Index]

Flags

NameDescriptionDefaultType
split-baseChoose the new smaller, split-up base package.EnabledAutomatic

Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info

Downloads

Maintainers' corner

For package maintainers and hackage trustees

Readme for hinotify-0.3.7

hinotify: inotify for Haskell

About

hinotify, a library to inotify which has been part of the Linux kernel since 2.6.13.

inotify provides file system event notification, simply add a watcher to a file or directory and get an event when it is accessed or modified.

This module is named hinotify.

See example code in the examples directory, distributed with the source code.

News

hinotify 0.3.7

hinotify 0.3.2

 -removeWatch :: INotify -> WatchDescriptor -> IO ()
 +removeWatch :: WatchDescriptor -> IO ()
 - { isDirecotry :: Bool
 + { isDirectory :: Bool

hinotify 0.3.1

hinotify 0.3

hinotify 0.2

hinotify 0.1 : Initial release

API

The API basically consists of:

initINotify :: IO INotify
addWatch :: INotify
         -> [EventVariety]   -- different events to listen on
         -> FilePath         -- file/directory to watch
         -> (Event -> IO ()) -- event handler
         -> IO WatchDescriptor
removeWatch :: WatchDescriptor -> IO ()

A sample program:

import System.Directory
import System.IO

import System.INotify

main :: IO ()
main = do
  inotify <- initINotify
  print inotify
  home <- getHomeDirectory
  wd <- addWatch
          inotify
          [Open,Close,Access,Modify,Move]
          home
          print
  print wd
  putStrLn "Listens to your home directory. Hit enter to terminate."
  getLine
  removeWatch wd

Download

The code is available via the homepage, and via darcs:

git clone https://github.com/kolmodin/hinotify.git

The API is available online.

I'm most grateful for feedback on the API, and what else you might have to suggest.

Author

Lennart Kolmodin

kolmodin at gmail.com

Legal

This software is released under a BSD-style license. See LICENSE for more details.

Copyright © 2007-2012 Lennart Kolmodin