From 7a09d74319c0e68dddfa2cf1979731a030e8881e Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 18 Jun 2012 23:47:48 -0400 Subject: lifted out the kqueue and inotify to a generic DirWatcher interface Kqueue code for dispatching events is not tested and probably doesn't build. --- Utility/Types/DirWatcher.hs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 Utility/Types/DirWatcher.hs (limited to 'Utility/Types/DirWatcher.hs') 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 + - + - 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 + } -- cgit v1.2.3