Re: run() not capturing exitcode properly?

2017-05-30 Thread Marcel Timmerman
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; -

Re: run() not capturing exitcode properly?

2017-05-29 Thread Gabor Szabo
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 > > >

run() not capturing exitcode properly?

2017-05-29 Thread Gabor Szabo
> 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