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

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




Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


  • No Candidates
Versions [RSS],,
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
Reverse Dependencies 1 direct, 0 indirect [details]
Downloads 2473 total (13 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-

[back to package description]


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
     --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)"
        $ sourceFileChanges (setRelative False $ mkFileChangeSettings dir)
       $$ mapM_C (liftIO . print)