{-# LANGUAGE MultiParamTypeClasses #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module System.Process.ByteString where import Control.Exception import Control.Monad import Data.ByteString (ByteString) import Data.ListLike (null) import Data.ListLike.IO (hGetContents, hPutStr) import Data.Word (Word8) import Prelude hiding (null) import System.Process import qualified System.Process.ListLike as LL import System.Exit (ExitCode) import System.IO (hClose, hFlush) import Utils (forkWait) -- | Like 'System.Process.readProcessWithExitCode', but using 'ByteString' instance LL.ListLikeProcessIO ByteString Word8 where forceOutput = return -- | Specialized version for backwards compatibility. readProcessWithExitCode :: FilePath -> [String] -> ByteString -> IO (ExitCode, ByteString, ByteString) readProcessWithExitCode = LL.readProcessWithExitCode readCreateProcessWithExitCode :: CreateProcess -> ByteString -> IO (ExitCode, ByteString, ByteString) readCreateProcessWithExitCode = LL.readCreateProcessWithExitCode