Skip to content

More pipes? #75

@LacticWhale

Description

@LacticWhale

Is there a way to open more pipes? In normal PHP I can use proc_open to do something like this:

$descriptors = array(
    0 => array("pipe", "r"),  // STDIN
    1 => array("pipe", "w"),  // STDOUT
    2 => array("pipe", "w"),  // STDERR
    3 => array("pipe", "w"),  // DATA
);
$proc = proc_open("data_handler", $descriptors, $pipes, "../../../submodules/data_handler/program");
foreach ($inputs as $input) 
    fwrite($pipes[0], $input.PHP_EOL);
fclose($pipes[0]);

$data   = stream_get_contents($pipes[3]); fclose($pipes[3]);
$stderr = stream_get_contents($pipes[2]); fclose($pipes[2]);
$stdout = stream_get_contents($pipes[1]); fclose($pipes[1]);
$exitCode = proc_close($proc);

I couldn't find any documentation on this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions