bind-stdout
ErrorsCollection

bind-stdout

Synthesised documentation from type/Proc/Async

From type/Proc/Async

See Original text in context

method bind-stdout(IO::Handle:D $handle)

Redirects STDOUT of the target process to a handle (which must be opened). If STDOUT is closed X::Proc::Async::BindOrUse will be thrown.

my $p = Proc::Async.new("ls":out);
my $h = "ls.out".IO.open(:w);
$p.bind-stdout($h);
$p.start;

This program will pipe the output of the ls shell command to a file called ls.out, which we are opened for reading.