Skip to content

Can't pipe stdout/stderr to the same pipe for a child process #871

Closed
@steveklabnik

Description

@steveklabnik

Issue by alexcrichton
Monday Nov 04, 2013 at 23:24 GMT

For earlier discussion, see rust-lang/rust#10269

This issue was labelled with: A-io in the Rust repository


This is more of a problem with the rt::io::process bindings rather than the std::run bindings (the latter needs a larger overhaul in general). The rt::io::process bindings currently don't expose the ability to have something like 2>&1 and then you capture the output of &1 (redirecting stderr to stdout and then reading stdout).

A possible solution is to add another enum variant to StdioContainer named along the lines of PipeTo(int) which means that the output of this stdio slot should get redirected to the pipe which was defined at slot int. Perhaps an IoError should be raised if it doesn't reference a CreatePipe slot, perhaps a failure.

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-libs-apiRelevant to the library API team, which will review and decide on the RFC.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions