asynchronous - How can I read from the standard error of another program, line by line? -
this program catches of standard error program, gives me partial line:
#!/bin/env perl6 $proc = proc::async.new('./print_to_stderr'); $proc.stderr.tap( -> $str { $str.lines() { put "captured err: $_"; } }); $promise = $proc.start; await $promise; using ./print_to_stderr:
#!/bin/env perl6 ^10 { $*err.put: "($_): howdee"; } just now, got following output:
captured err: (0): howdee captured err: (1): howdee ... captured err: (6): howdee captured err: (7): howde captured err: e captured err: (8): howdee as see, item 7, standard error broken between 2 different taps. i'd wait , give me whole line.
update: reproducible me using rakudo star 2017.04, isn't issue in rakudo star 2017.07 pointed out elizabeth mattijsen below.
which version of rakudo perl 6 using? cannot reproduce issue. in case, supply.lines should not give incomplete lines, ever. if happening on recent version of rakudo perl 6, should reported bug.
Comments
Post a Comment