Z-IO-0.2.0.0: Simple and high performance IO toolkit for Haskell
Copyright(c) Dong Han 2017-2020
LicenseBSD
Maintainerwinterland1989@gmail.com
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

Z.IO.FileSystem.Watch

Description

This module provides fs watcher based on libuv's fs_event, we also maintain watch list if target OS doesn't support recursive watch(Linux's inotify).

-- start watching threads, use returned close function to cleanup watching threads.
(close, srcf) <- watchDirs ["fold_to_be_watch"]
-- dup a file event source
src <- srcf
-- print event to stdout
runBIO $ src >|> sinkToIO printLineStd
Synopsis

Documentation

data FileEvent Source #

File event with path info.

Instances

Instances details
Eq FileEvent Source # 
Instance details

Defined in Z.IO.FileSystem.Watch

Ord FileEvent Source # 
Instance details

Defined in Z.IO.FileSystem.Watch

Read FileEvent Source # 
Instance details

Defined in Z.IO.FileSystem.Watch

Show FileEvent Source # 
Instance details

Defined in Z.IO.FileSystem.Watch

Generic FileEvent Source # 
Instance details

Defined in Z.IO.FileSystem.Watch

Associated Types

type Rep FileEvent :: Type -> Type #

ToValue FileEvent Source # 
Instance details

Defined in Z.IO.FileSystem.Watch

Methods

toValue :: FileEvent -> Value #

EncodeJSON FileEvent Source # 
Instance details

Defined in Z.IO.FileSystem.Watch

Methods

encodeJSON :: FileEvent -> Builder () #

FromValue FileEvent Source # 
Instance details

Defined in Z.IO.FileSystem.Watch

ShowT FileEvent Source # 
Instance details

Defined in Z.IO.FileSystem.Watch

Methods

toUTF8BuilderP :: Int -> FileEvent -> Builder () #

type Rep FileEvent Source # 
Instance details

Defined in Z.IO.FileSystem.Watch

watchDirs :: [CBytes] -> IO (IO (), IO (Source FileEvent)) Source #

Start watching a list of given directories.

watchDirsRecursively :: [CBytes] -> IO (IO (), IO (Source FileEvent)) Source #

Start watching a list of given directories recursively.