hinotify: Haskell binding to INotify

[ bsd3, library, system ] [ Propose Tags ]

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]

Modules

[Index]

Flags

Automatic Flags
NameDescriptionDefault
split-base

Choose the new smaller, split-up base package.

Enabled

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

Downloads

Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.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, 0.3.9, 0.3.10, 0.4, 0.4.1 (info)
Dependencies base (<4.3), containers, directory, unix [details]
License BSD-3-Clause
Author Lennart Kolmodin
Maintainer Lennart Kolmodin <kolmodin@gentoo.org>
Revised Revision 1 made by HerbertValerioRiedel at 2018-10-02T12:07:05Z
Category System
Home page http://haskell.org/~kolmodin/code/hinotify/README.html
Uploaded by LennartKolmodin at 2007-12-26T11:43:33Z
Distributions Arch:0.4.1, Debian:0.4, Fedora:0.4.1, FreeBSD:0.3.8.1, LTSHaskell:0.4.1, NixOS:0.4.1, Stackage:0.4.1, openSUSE:0.4.1
Reverse Dependencies 21 direct, 216 indirect [details]
Downloads 74767 total (154 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]

Readme for hinotify-0.2

[back to package description]
% hinotify: inotify for Haskell
% Lennart Kolmodin <kolmodin@gentoo.org>
% December 26, 2007

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 `inotify`.

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

[inotify]: http://www.kernel.org/pub/linux/kernel/people/rml/inotify/

News
----

**hinotify 0.2**
:   * Updates to the API
        - Function names is now in semiCamelCase
        - Restructure event parameters to make it more consistent
    * Small test suit in `tests/`
    * Compiles with GHC 6.8.2 and GHC 6.6.1
    * Requires Cabal 1.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 :: INotify -> 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 inotify wd


Download
--------

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

    darcs get --partial http://haskell.org/~kolmodin/code/hinotify/

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 gentoo.org`

Legal
-----

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

Copyright &copy; 2007 Lennart Kolmodin

[homepage]: http://haskell.org/~kolmodin/code/hinotify/

[API]: http://haskell.org/~kolmodin/code/hinotify/docs/api/