Permalink
Browse files

flush $*OUT in &prompt

  • Loading branch information...
1 parent e095de4 commit b72c434660038468df41cd64876fdc230bdc0405 @moritz moritz committed Sep 22, 2012
Showing with 8 additions and 1 deletion.
  1. +8 −1 src/core/IO.pm
View
@@ -25,6 +25,7 @@ sub gist(|) {
sub prompt($msg) {
print $msg;
+ $*OUT.flush();
$*IN.get;
}
@@ -78,7 +79,6 @@ my role IO::FileTestable {
method changed() {
nqp::p6box_i(nqp::stat(nqp::unbox_s($.path), pir::const::STAT_CHANGETIME));
}
-
}
class IO does IO::FileTestable {
@@ -235,6 +235,13 @@ class IO does IO::FileTestable {
method Str {
$.path
}
+
+ method flush() {
+ fail("File handle not open, so cannot flush")
+ unless nqp::defined($!PIO);
+ $!PIO.flush();
+ True;
+ }
}
my class IO::Path is Cool does IO::FileTestable {

0 comments on commit b72c434

Please sign in to comment.