core :: FileWriter :: write_native
len
bytes from native
.
# Write `len` bytes from `native`.
private fun write_native(native: CString, from, len: Int)
do
if last_error != null then return
if not _is_writable then
last_error = new IOError("Cannot write to non-writable stream")
return
end
if _file.as(not null).address_is_null then
last_error = new IOError("Writing on a null stream")
_is_writable = false
return
end
var err = _file.as(not null).io_write(native, from, len)
if err != len then
# Big problem
last_error = new IOError("Problem in writing : {err} {len} \n")
end
end
lib/core/file.nit:258,2--276,4