Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Branch: master
Fetching contributors…
Cannot retrieve contributors at this time
59 lines (43 sloc) 1.59 KB
I'm pleased to announce hinotify 0.1, a library to inotify[1] 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.
The API basically consists of:
inotify_init :: IO INotify
inotify_add_watch :: INotify
-> [EventVariety] -- different events to listen on
-> FilePath -- file/directory to watch
-> (Event -> IO ()) -- event handler
-> IO WatchDescriptor
inotify_rm_watch :: INotify -> WatchDescriptor -> IO ()
A sample program:
> import System.Directory
> import System.IO
> import System.INotify
> main :: IO ()
> main = do
> inotify <- inotify_init
> print inotify
> home <- getHomeDirectory
> wd <- inotify_add_watch inotify
> [Open,Close,Access,Modify,Move]
> home
> print
> print wd
> putStrLn "Listens to your home directory. Hit enter to terminate."
> getLine
> inotify_rm_watch inotify wd
The code is available via www:
and via darcs:
darcs get
The API is available at:
The library is very young and I'm most grateful for feedback on the API,
and what else you might have to suggest.
Lennart Kolmodin
Jump to Line
Something went wrong with that request. Please try again.