#include <errno.h>
`}
-# File Abstract Stream
+# `Stream` used to interact with a File or FileDescriptor
abstract class FileStream
super Stream
# The path of the file.
end
end
-# File input stream
+# `Stream` that can read from a File
class FileReader
super FileStream
super BufferedReader
end
end
-# File output stream
+# `Stream` that can write to a File
class FileWriter
super FileStream
super Writer
_file = new NativeFile.native_stdout
path = "/dev/stdout"
_is_writable = true
+ set_buffering_mode(256, sys.buffer_mode_line)
end
end
redef class Sys
- init do
- if stdout isa FileStream then stdout.as(FileStream).set_buffering_mode(256, buffer_mode_line)
- end
-
# Standard input
var stdin: PollableReader = new Stdin is protected writable