cabal-install-3.8.1.0: The command-line interface for Cabal and Hackage.
Copyright(c) 2013 Liu Hao Brent Yorgey
LicenseBSD-style (see the file LICENSE)
Maintainercabal-devel@haskell.org
Stabilityprovisional
Portabilityportable
Safe HaskellSafe-Inferred
LanguageHaskell2010

Distribution.Client.Compat.Process

Description

Cross-platform utilities for invoking processes.

Synopsis

Documentation

readProcessWithExitCode :: FilePath -> [String] -> String -> IO (ExitCode, String, String) Source #

readProcessWithExitCode creates an external process, reads its standard output and standard error strictly, waits until the process terminates, and then returns the ExitCode of the process, the standard output, and the standard error.

See the documentation of the version from System.Process for more information.

The version from System.Process behaves inconsistently across platforms when an executable with the given name is not found: in some cases it returns an ExitFailure, in others it throws an exception. This variant catches "does not exist" and "permission denied" exceptions and turns them into ExitFailures.

TODO: this doesn't use Process.