-- generic AMQP publisher
-
import Control.Concurrent (threadDelay)
import qualified Control.Exception as X
import Control.Monad (forever)
inotify
[CloseWrite, MoveIn]
(inputFile args)
- (handleEvent publishOneMsg (suffix args))
+ (handleEvent publishOneMsg (suffix args) (inputFile args))
hr $ "watching " ++ (inputFile args)
_ <- forever $ threadDelay 1000000
removeWatch wd
-- | Hotfolder event handler
handleEvent ::
- (Maybe String -> BL.ByteString -> IO ()) -> [String] -> Event -> IO ()
+ (Maybe String -> BL.ByteString -> IO ())
+ -> [String]
+ -> String
+ -> Event
+ -> IO ()
-- just handle closewrite and movedin events
-handleEvent f s (Closed False (Just x) True) = handleFile f s x
-handleEvent f s (MovedIn False x _) = handleFile f s x
-handleEvent _ _ _ = return ()
+handleEvent f s p (Closed False (Just x) True) = handleFile f s (p ++ "/" ++ x)
+handleEvent f s p (MovedIn False x _) = handleFile f s (p ++ "/" ++ x)
+handleEvent _ _ _ _ = return ()
-- | Hotfolder file handler
handleFile ::
+haskell-amqp-utils (0.3.2.2) unstable; urgency=medium
+
+ * fix hotfolder mode in other than cwd
+
+
haskell-amqp-utils (0.3.2.1) unstable; urgency=medium
* fix doc