shithub: MicroHs

ref: 31c412e072c33af1f5a0ef104e5e3c28c1768254
dir: /lib/System/Process.hs/

View raw version
module System.Process(callCommand) where
import Prelude
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