1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247
|
<!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>
|