hinotify-0.3.2: README.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>hinotify: inotify for Haskell</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="pandoc" />
<meta name="author" content="Lennart Kolmodin
'+''+e+''+'');
// -->
kolmodin at gmail dot com" />
<meta name="date" content="December 26, 2007–2011" />
<link rel="stylesheet" href="hinotify.css" type="text/css" />
</head>
<body>
<h1 class="title">hinotify: inotify for Haskell</h1>
<div id="TOC"
><ul
><li
><a href="#about"
>About</a
></li
><li
><a href="#news"
>News</a
></li
><li
><a href="#api"
>API</a
></li
><li
><a href="#download"
>Download</a
></li
><li
><a href="#author"
>Author</a
></li
><li
><a href="#legal"
>Legal</a
></li
></ul
></div
>
<div id="about"
><h2
><a href="#TOC"
>About</a
></h2
><p
>hinotify, a library to <a href="http://www.kernel.org/pub/linux/kernel/people/rml/inotify/"
>inotify</a
> which has been part of the Linux kernel since 2.6.13.</p
><p
>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.</p
><p
>This module is named <code
>hinotify</code
>.</p
><p
>See example code in the <code
>examples</code
> directory, distributed with the source code.</p
></div
><div id="news"
><h2
><a href="#TOC"
>News</a
></h2
><p
><strong
>hinotify 0.3.2</strong
></p
><ul
><li
>Make each <code
>WatchDescriptor</code
> contain its <code
>INotify</code
>. Changes to the function types:</li
></ul
><blockquote
><pre
><code
> -removeWatch :: INotify -> WatchDescriptor -> IO ()
+removeWatch :: WatchDescriptor -> IO ()
</code
></pre
></blockquote
><ul
><li
>Fix typo in declaration of <code
>Deleted</code
> in <code
>data Event</code
>;</li
></ul
><blockquote
><pre
><code
> - { isDirecotry :: Bool
+ { isDirectory :: Bool
</code
></pre
></blockquote
><p
><strong
>hinotify 0.3.1</strong
></p
><ul
><li
>Use <code
>inotify.h</code
> from <code
>glibc</code
> rather than from the linux headers, as recommended upstream.</li
></ul
><p
><strong
>hinotify 0.3</strong
></p
><ul
><li
>Compiles with GHC 6.12, GHC 6.10.4, GHC 6.8.2 and GHC 6.6.1</li
></ul
><p
><strong
>hinotify 0.2</strong
></p
><ul
><li
>Updates to the API<ul
><li
>Function names is now in semiCamelCase</li
><li
>Restructure event parameters to make it more consistent</li
></ul
></li
><li
>Small test suit in <code
>tests/</code
></li
><li
>Compiles with GHC 6.8.2 and GHC 6.6.1</li
><li
>Requires Cabal 1.2</li
></ul
><dl
><dt
><strong
>hinotify 0.1</strong
></dt
><dd
>Initial release</dd
></dl
></div
><div id="api"
><h2
><a href="#TOC"
>API</a
></h2
><p
>The API basically consists of:</p
><pre
><code
>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 ()
</code
></pre
><p
>A sample program:</p
><pre
><code
>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
</code
></pre
></div
><div id="download"
><h2
><a href="#TOC"
>Download</a
></h2
><p
>The code is available via the <a href="http://code.haskell.org/hinotify/"
>homepage</a
>, and via darcs:</p
><pre
><code
>darcs get --partial http://code.haskell.org/hinotify/
</code
></pre
><p
>The <a href="http://hackage.haskell.org/packages/archive/hinotify/latest/doc/html/System-INotify.html"
>API</a
> is available online.</p
><p
>I’m most grateful for feedback on the API, and what else you might have to suggest.</p
></div
><div id="author"
><h2
><a href="#TOC"
>Author</a
></h2
><p
>Lennart Kolmodin</p
><p
><code
>kolmodin at gmail.com</code
></p
></div
><div id="legal"
><h2
><a href="#TOC"
>Legal</a
></h2
><p
>This software is released under a BSD-style license. See LICENSE for more details.</p
><p
>Copyright © 2007–2011 Lennart Kolmodin</p
></div
>
</body>
</html>