lifted out the kqueue and inotify to a generic DirWatcher interface
Kqueue code for dispatching events is not tested and probably doesn't build.
This commit is contained in:
parent
9b7f929e96
commit
7a09d74319
6 changed files with 115 additions and 54 deletions
22
Utility/Types/DirWatcher.hs
Normal file
22
Utility/Types/DirWatcher.hs
Normal file
|
@ -0,0 +1,22 @@
|
|||
{- generic directory watching types
|
||||
-
|
||||
- Copyright 2012 Joey Hess <joey@kitenet.net>
|
||||
-
|
||||
- Licensed under the GNU GPL version 3 or higher.
|
||||
-}
|
||||
|
||||
{-# LANGUAGE CPP #-}
|
||||
|
||||
module Utility.Types.DirWatcher where
|
||||
|
||||
import Common
|
||||
|
||||
type Hook a = Maybe (a -> Maybe FileStatus -> IO ())
|
||||
|
||||
data WatchHooks = WatchHooks
|
||||
{ addHook :: Hook FilePath
|
||||
, addSymlinkHook :: Hook FilePath
|
||||
, delHook :: Hook FilePath
|
||||
, delDirHook :: Hook FilePath
|
||||
, errHook :: Hook String -- error message
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue