-- | hotfolder event handler
handleEvent :: (BL.ByteString -> IO ()) -> Event -> IO ()
-handleEvent f (Closed False (Just x) True) = hr x >> BL.readFile x >>= f
-handleEvent f (MovedIn False x _) = hr x >> BL.readFile x >>= f
+handleEvent f (Closed False (Just x) True) = handleFile f x
+handleEvent f (MovedIn False x _) = handleFile f x
handleEvent _ _ = return ()
+
+-- | hotfolder file handler
+handleFile :: (BL.ByteString -> IO ()) -> FilePath -> IO ()
+handleFile _ ('.':_) = return ()
+handleFile f x = hr x >> BL.readFile x >>= f