The fsnotify-conduit package

[Tags:library, mit, test]

Please see README.md


[Skip to Readme]

Properties

Versions 0.1.0.0
Change log ChangeLog.md
Dependencies base (>=4.7 && <5), conduit, directory, filepath, fsnotify, resourcet, transformers [details]
License MIT
Copyright 2016 FP Complete
Author Michael Snoyman
Maintainer michael@snoyman.com
Category Data, Conduit
Home page https://github.com/fpco/fsnotify-conduit#readme
Source repository head: git clone https://github.com/fpco/fsnotify-conduit
Uploaded Thu Sep 8 10:29:28 UTC 2016 by MichaelSnoyman
Distributions LTSHaskell:0.1.0.0, NixOS:0.1.0.0, Stackage:0.1.0.0, Tumbleweed:0.1.0.0
Downloads 102 total (15 in the last 30 days)
Votes
0 []
Status Docs available [build log]
Last success reported on 2016-09-08 [all 1 reports]
Hackage Matrix CI

Modules

[Index]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees

Readme for fsnotify-conduit

Readme for fsnotify-conduit-0.1.0.0

fsnotify-conduit

Get filesystem notifications as a stream of events, using the conduit package to handle the stream. This uses the fsnotify package, which uses OS-specific file notification APIs for efficiency. Simple usage example, a program which will print all events for the given directory tree:

#!/usr/bin/env stack
{- stack
     --resolver lts-6.15
     --install-ghc
     runghc
     --package fsnotify-conduit
     --package conduit-combinators
 -}

import Conduit
import Data.Conduit.FSNotify
import System.Environment (getArgs)

main :: IO ()
main = do
    args <- getArgs
    dir <-
        case args of
            [dir] -> return dir
            _ -> error $ "Expected one argument (directory to watch)"
    runResourceT
        $ sourceFileChanges (setRelative False $ mkFileChangeSettings dir)
       $$ mapM_C (liftIO . print)