Advertisement
Guest User

Untitled

a guest
Apr 24th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. command_outside :: String -> [String] -> IO (String, ExitCode)
  2. command_outside name args = do
  3.                             (input, output, err, handle) <- (runInteractiveProcess name args Nothing Nothing)
  4.                             exit_code <- waitForProcess handle
  5.                             out_ <- (System.IO.Streams.Internal.read output)
  6.                             case out_ of
  7.                                 Nothing -> return ("", exit_code)
  8.                                 Just value -> do
  9.                                               let out = (fromByteString value)
  10.                                               case out of
  11.                                                   Nothing -> return ("", exit_code)
  12.                                                   Just a -> return (a, exit_code)
  13.  
  14. command_exit :: IO ()
  15. command_exit = exitWith ExitSuccess
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement