Skip to content

Binary I/O versions of readProcess, readProcessWithExitCode, etc. #59

@ghost

Description

It would be useful to have versions of readProcess etc. that support binary IO on stdin/stdout.
Proposed solution: a new module (intended to be imported qualified alongside System.Process) with the following signature:

module System.Process.Binary where
import Data.ByteString.Lazy (ByteString)
readProcess :: FilePath -> [String] -> ByteString -> IO ByteString
readCreateProcess :: CreateProcess -> ByteString -> IO ByteString
readProcessWithExitCode :: FilePath -> [String] -> ByteString -> IO (ExitCode,ByteString,ByteString)
readCreateProcessWithExitCode :: CreateProcess -> ByteString -> IO (ExitCode,ByteString,ByteString)

Additionally, I propose adding a new constructor CreateBinaryPipe to the StdStream data type (CreateBinaryPipe would be to CreatePipe as openBinaryFile is to openFile).

If there are no objections, I'd be happy to implement this myself and submit a patch. Note that it would require adding bytestring as a package dependency.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions