-{-# OPTIONS -cpp -fffi #-}
+{-# OPTIONS_GHC -cpp -fffi #-}
-----------------------------------------------------------------------------
-- |
-- Module : System.Process
terminateProcess,
) where
+import Prelude
+
import System.Process.Internals
import Foreign
runCommand string = do
(cmd,args) <- commandToProcess string
-#if !defined(mingw32_TARGET_OS) && !defined(__MINGW32__)
+#if !defined(mingw32_HOST_OS) && !defined(__MINGW32__)
runProcess1 "runCommand" cmd args Nothing Nothing Nothing Nothing Nothing
#else
runProcess1 "runCommand" cmd [] Nothing Nothing Nothing Nothing Nothing args
-> Maybe Handle -- ^ Handle to use for @stderr@
-> IO ProcessHandle
-#if !defined(mingw32_TARGET_OS) && !defined(__MINGW32__)
+#if !defined(mingw32_HOST_OS) && !defined(__MINGW32__)
runProcess cmd args mb_cwd mb_env mb_stdin mb_stdout mb_stderr
= runProcess1 "runProcess" cmd args mb_cwd mb_env mb_stdin mb_stdout mb_stderr
runInteractiveCommand string = do
(cmd,args) <- commandToProcess string
-#if !defined(mingw32_TARGET_OS) && !defined(__MINGW32__)
+#if !defined(mingw32_HOST_OS) && !defined(__MINGW32__)
runInteractiveProcess1 "runInteractiveCommand" cmd args Nothing Nothing
#else
runInteractiveProcess1 "runInteractiveCommand" cmd [] Nothing Nothing args
-> Maybe [(String,String)] -- ^ Optional environment (otherwise inherit)
-> IO (Handle,Handle,Handle,ProcessHandle)
-#if !defined(mingw32_TARGET_OS) && !defined(__MINGW32__)
+#if !defined(mingw32_HOST_OS) && !defined(__MINGW32__)
runInteractiveProcess cmd args mb_cwd mb_env =
runInteractiveProcess1 "runInteractiveProcess" cmd args mb_cwd mb_env
fd <- peek pfd
openFd fd (Just Stream)
False{-not a socket-}
- ("fd:" ++ show fd) mode True{-binary-} False{-no truncate-}
+ ("fd:" ++ show fd) mode True{-binary-}
-- ----------------------------------------------------------------------------
-- waitForProcess
Windows isn't required (or desirable) here.
-}
-#if !defined(mingw32_TARGET_OS) && !defined(__MINGW32__)
+#if !defined(mingw32_HOST_OS) && !defined(__MINGW32__)
commandToProcess
:: String
mapEx (IOException (IOError h iot fun str _)) = ioError (IOError h iot fun str (Just fpath))
mapEx e = throwIO e
-#if !defined(mingw32_TARGET_OS) && !defined(__MINGW32__)
+#if !defined(mingw32_HOST_OS) && !defined(__MINGW32__)
withCEnvironment :: [(String,String)] -> (Ptr CString -> IO a) -> IO a
withCEnvironment env act =
let env' = map (\(name, val) -> name ++ ('=':val)) env
use lpCommandLine alone, which CreateProcess supports.
-}
-#if defined(mingw32_TARGET_OS)
+#if defined(mingw32_HOST_OS)
-- Translate command-line arguments for passing to CreateProcess().
translate :: String -> String