launch :: Integer -> [String] -> [String] -> IO ()
launch max' suffixes argv = do
 ch <- newChan
 mapM_ (\n -> forkIO $ dupChan ch >>= \nch -> forever $ runBackendStdout n nch) [1..max']
 mapM_ (\n -> forkIO $ dupChan ch >>= \nch -> forever $ runBackendFile ("/tmp/logfs."++show n++".log") nch) [1..max']

 let
  hash :: Hash.PerfectHash Bool
  hash = Hash.fromList $ map (\x -> (B.pack x, True)) suffixes

 let
  backendHandler :: Packet -> IO ()
  backendHandler pkt = do
   writeChan ch pkt

  dirFilter :: String -> Bool
  dirFilter s = isJust $ Hash.lookup hash (B.pack s)

 runLogFS "logfs" argv backendHandler dirFilter defaultExceptionHandler
launch :: Integer -> [String] -> [String] -> IO ()
launch max' suffixes argv = do
 ch <- newChan
 mapM_ (\n -> forkIO $ dupChan ch >>= \nch -> forever $ runBackendStdout n nch) [1..max']
 mapM_ (\n -> forkIO $ dupChan ch >>= \nch -> forever $ runBackendFile ("/tmp/logfs."++show n++".log") nch) [1..max']

 let
  hash :: Hash.PerfectHash Bool
  hash = Hash.fromList $ map (\x -> (B.pack x, True)) suffixes

 let
  backendHandler :: Packet -> IO ()
  backendHandler pkt = do
   writeChan ch pkt

  dirFilter :: String -> Bool
  dirFilter s = isJust $ Hash.lookup hash (B.pack s)

 runLogFS "logfs" argv backendHandler dirFilter defaultExceptionHandler
launch max' suffixes argv = do
 ch <- newChan
 mapM_ (\n -> forkIO $ dupChan ch >>= \nch -> forever $ runBackendStdout n nch) [1..max']
 mapM_ (\n -> forkIO $ dupChan ch >>= \nch -> forever $ runBackendFile ("/tmp/logfs."++show n++".log") nch) [1..max']

 let
  hash :: Hash.PerfectHash Bool
  hash = Hash.fromList $ map (\x -> (B.pack x, True)) suffixes

 let
  backendHandler :: Packet -> IO ()
  backendHandler pkt = do
   writeChan ch pkt

  dirFilter :: String -> Bool
  dirFilter s = isJust $ Hash.lookup hash (B.pack s)

 runLogFS "logfs" argv backendHandler dirFilter defaultExceptionHandler