Method Stdio.Buffer()->output_to()
- Method output_to
int(-1..)output_to(Stdio.Stream|function(string:int)fun,int(0..)|voidnbytes)- Description
Write data from the buffer to the indicated file.
- Parameter
fun Write function. Either one of:
Stdio.StreamA file object in which the function
write()will be called.function(string:int)A function which will be called with a
string(8bit)to write and is expected to return anintindicating the number of bytes successfully written or-1on failure.- Parameter
nbytes If
nbytesis not specified the whole buffer will be written if possible. Otherwise at mostnbyteswill be written.- Returns
Will return the number of bytes that have been written successfully.
If no bytes have been written successfully and
fun()failed with an error,-1will be returned.