fsnotify-conduit: Get filesystem notifications as a stream of events

[ conduit, data, library, mit ] [ Propose Tags ]

Modules

[Index]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0.0, 0.1.1.0, 0.1.1.1
Change log ChangeLog.md
Dependencies base (>=4.9 && <5), conduit (>=1.2.8), directory, filepath, fsnotify (>=0.2.1), resourcet, transformers [details]
License MIT
Copyright 2016-2018 FP Complete
Author Michael Snoyman
Maintainer michael@snoyman.com
Category Data, Conduit
Home page https://github.com/fpco/fsnotify-conduit#readme
Bug tracker https://github.com/fpco/fsnotify-conduit/issues
Source repo head: git clone https://github.com/fpco/fsnotify-conduit
Uploaded by MichaelSnoyman at 2018-06-04T15:35:45Z
Distributions
Reverse Dependencies 1 direct, 0 indirect [details]
Downloads 2433 total (14 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2018-06-04 [all 1 reports]

Readme for fsnotify-conduit-0.1.1.1

[back to package description]

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)