Writes the string str in the File. If the string cannot be written completely an error is raised, except if File is in quiet() mode where it returns the number of character actually written.