Top index Wirbel home

fs::write

file.write(string) - write a string to a file
file.write(string, int) - write beginning of a string to a file
file.write(char) - write a single character/byte to a file

file.write(string) writes a string binary safe to a file. The string may be empty - in which case nothing is written. But it must not be null.

file.write(string, int) writes only the first n bytes of the string to the file. If the string is short than that, it is written completely. This is not considered to be an error. Note that this version of write does avoid creating a copy of the substring to be written.

file.write(char) writes a single character to an open file. In essence exactly one byte is being written.