Hi
Exit code is set after closing one of the output channels. If you close
both, the errorcode is reset to 0 again. (This might be a bug though)
my $p = run "ls", "dadsad", :out, :err;
say $p.err.lines;
---> (ls: cannot access 'dadsad': No such file or directory)
$p.out.close;
$p.exitcode;
-
On Tue, May 30, 2017 at 7:21 AM, Gabor Szabo wrote:
>> my $p = run "ls", "dadsad", :out, :err;
> Proc.new(in => IO::Pipe, out => IO::Pipe.new(:path(""),:chomp), err =>
> IO::Pipe.new(:path(""),:chomp), exitcode => 0, signal => 0, command =>
> ["ls", "dadsad", "adadsa"])
>>
>> $p.exitcode
> 0
>
>
>
> my $p = run "ls", "dadsad", :out, :err;
Proc.new(in => IO::Pipe, out => IO::Pipe.new(:path(""),:chomp), err =>
IO::Pipe.new(:path(""),:chomp), exitcode => 0, signal => 0, command =>
["ls", "dadsad", "adadsa"])
>
> $p.exitcode
0
While for the same command in the shell $? will hold 1 as the
dir