-
-
Save donaldh/4ada7d00c4d64a4efc15 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
my Mu $PIO; | |
sub read(Cool $bufsize as Int) { | |
my $res = buf8.new(); | |
repeat { | |
my $buf := buf8.new(); | |
nqp::readfh($PIO, $buf, nqp::unbox_i($bufsize - $res.elems)); | |
$res ~= $buf; | |
} while $res.elems < $bufsize && $buf.elems; | |
$res; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment