sys: Force the buffering of stdin and stdout as Line-buffered
authorLucas Bajolet <r4pass@hotmail.com>
Mon, 8 Dec 2014 16:14:16 +0000 (11:14 -0500)
committerLucas Bajolet <r4pass@hotmail.com>
Wed, 10 Dec 2014 19:24:56 +0000 (14:24 -0500)
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>

lib/standard/file.nit

index 2f93d4e..369d991 100644 (file)
@@ -712,6 +712,10 @@ end
 
 redef class Sys
 
+       init do
+               if stdout isa FStream then stdout.as(FStream).set_buffering_mode(256, buffer_mode_line)
+       end
+
        # Standard input
        var stdin: PollableIStream = new Stdin is protected writable