core :: FileStream :: set_buffering_mode
If the buf_size is <= 0, its value will be 512 by default
The mode is any of the buffer_mode enumeration in Sys
:
# Sets the buffering mode for the current FileStream
#
# If the buf_size is <= 0, its value will be 512 by default
#
# The mode is any of the buffer_mode enumeration in `Sys`:
#
# * `buffer_mode_full`
# * `buffer_mode_line`
# * `buffer_mode_none`
fun set_buffering_mode(buf_size, mode: Int) do
if buf_size <= 0 then buf_size = 512
if _file.as(not null).set_buffering_type(buf_size, mode) != 0 then
last_error = new IOError("Error while changing buffering type for FileStream, returned error {sys.errno.strerror}")
end
end
lib/core/file.nit:84,2--98,4