shithub: MicroHs

ref: e1db93e902de05e48d3362d13f0b809b888b6dbc
dir: /lib/System/Process.hs/

View raw version
module System.Process(callCommand) where
import Prelude(); import MiniPrelude
import Control.Monad(when)
import Foreign.C.String

foreign import ccall "system" systemc :: CString -> IO Int

callCommand :: String -> IO ()
callCommand cmd = do
  r <- withCAString cmd systemc
  when (r /= 0) $
    error $ "callCommand: failed " ++ show r ++ ", " ++ show cmd