| Copyright | (c) Dong Han 2017-2020 |
|---|---|
| License | BSD |
| Maintainer | winterland1989@gmail.com |
| Stability | experimental |
| Portability | non-portable |
| Safe Haskell | None |
| Language | Haskell2010 |
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, cleanup watching threads automatically when finished.
withResource (initWatchDirs ["fold_to_be_watch"] True) $ srcf -> do
-- dup a file event source
src <- srcf
-- print event to stdout
runBIO $ src >|> sinkToIO printStd
Documentation
File event with path info.
Constructors
| FileAdd CBytes | |
| FileRemove CBytes | |
| FileModify CBytes |
Instances
| Eq FileEvent Source # | |
| Ord FileEvent Source # | |
| Read FileEvent Source # | |
| Show FileEvent Source # | |
| Generic FileEvent Source # | |
| JSON FileEvent Source # | |
| Print FileEvent Source # | |
Defined in Z.IO.FileSystem.Watch Methods toUTF8BuilderP :: Int -> FileEvent -> Builder () # | |
| type Rep FileEvent Source # | |
Defined in Z.IO.FileSystem.Watch type Rep FileEvent = D1 ('MetaData "FileEvent" "Z.IO.FileSystem.Watch" "Z-IO-0.6.4.0-3RdtkLMi3pWlcaS0GimBE" 'False) (C1 ('MetaCons "FileAdd" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 CBytes)) :+: (C1 ('MetaCons "FileRemove" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 CBytes)) :+: C1 ('MetaCons "FileModify" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 CBytes)))) | |