Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Generic versions of cmd
, cmdTimeout
etc
- executeFile' :: FilePath -> Bool -> [String] -> Maybe [(String, String)] -> IO ()
- readCommand :: FilePath -> [String] -> IO (ProcessID, IO String)
- readCommand_ :: NFData a => (Handle -> IO a) -> FilePath -> [String] -> IO (ProcessID, IO a)
- cmd :: FilePath -> [String] -> IO String
- cmd_ :: NFData b => (Handle -> IO b) -> FilePath -> [String] -> IO b
- cmdTimeout :: FilePath -> [String] -> Int -> IO (Maybe String)
- cmdTimeout_ :: NFData a => (Handle -> IO a) -> FilePath -> [String] -> Int -> IO (Maybe a)
Documentation
executeFile' :: FilePath -> Bool -> [String] -> Maybe [(String, String)] -> IO () Source #
wrapped executeFile that reports error
readCommand :: FilePath -> [String] -> IO (ProcessID, IO String) Source #
readCommand command args
: given a command to run in a subprocess,
and args to pass to it --
return the childPid of the subprocess, and a function for
reading its output.
if it doesn't start with a forward-slash, the command is searched for in the current path.
readCommand_ :: NFData a => (Handle -> IO a) -> FilePath -> [String] -> IO (ProcessID, IO a) Source #
More general version of readCommand_
. First arg is
a function to read from the combined stdout/stderr
handle.
cmd :: FilePath -> [String] -> IO String Source #
cmd command args
: execute command with args; read combined stdout and stderr;
return it as a string
If there is an error executing the command, it'll get caught
and a Haskell error message will get printed.
cmd_ :: NFData b => (Handle -> IO b) -> FilePath -> [String] -> IO b Source #
more general version of cmd
.