fsnotify-conduit

Get filesystem notifications as a stream of events

https://github.com/fpco/fsnotify-conduit#readme

Version on this page:0.1.0.0
LTS Haskell 20.26:0.1.1.1
Stackage Nightly 2022-11-17:0.1.1.1
Latest on Hackage:0.1.1.1

See all snapshots fsnotify-conduit appears in

MIT licensed by Michael Snoyman
Maintained by [email protected]
This version can be pinned in stack with:fsnotify-conduit-0.1.0.0@sha256:81b474c829b58fd8f82747d53852895c533af16076ca0a62586eb92e452cef76,1605

Module documentation for 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)

Changes

0.1.0.0

  • Initial release