diff options
author | Joey Hess <joey@kitenet.net> | 2012-06-18 23:47:48 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-06-18 23:49:07 -0400 |
commit | 7a09d74319c0e68dddfa2cf1979731a030e8881e (patch) | |
tree | bc4acc8901ef7aa80091b29ba3ce57a6654c811a /Utility/Types | |
parent | 9b7f929e96531ea3e8b93880ab130179c2fd5107 (diff) |
lifted out the kqueue and inotify to a generic DirWatcher interface
Kqueue code for dispatching events is not tested and probably doesn't
build.
Diffstat (limited to 'Utility/Types')
-rw-r--r-- | Utility/Types/DirWatcher.hs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/Utility/Types/DirWatcher.hs b/Utility/Types/DirWatcher.hs new file mode 100644 index 000000000..c828a0593 --- /dev/null +++ b/Utility/Types/DirWatcher.hs @@ -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 + } |