Created
November 15, 2016 11:47
-
-
Save gfldex/a4d6908a2f1072bdcb6e05f88b8f8f82 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use v6; | |
CATCH { default { say .^name; say .Str } } | |
# say qx{find / -print}.lines; | |
# if qx{} steps onto malformed utf8: Unable to read from 'find / -print' | |
# exit 0; | |
my $find = Proc::Async.new(|<find / -print>); | |
react { | |
whenever $find.stdout(:bin) -> $line { | |
QUIT { when X::AdHoc { say .^name, .Str } } | |
print $line.decode('utf8-c8'); | |
} | |
whenever $find.stderr(:bin) -> $line { | |
QUIT { say .^name } | |
# put "FAIL: $line" | |
} | |
$find.start; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment