| Extracted from Pike v7.8 release 866 at 2018-02-09.

[Top]
Stdio

# Method Stdio.write_file()

Method write_file

  `int write_file(string filename, string str, int|void access)`

Description

  Write the string str onto the file filename . Any existing data in the file is overwritten.

  For a description of access , see Stdio.File()->open() .

Throws

  Throws an error if filename couldn't be opened for writing.

Returns

  Returns the number of bytes written, i.e. `sizeof(str)`.

See also

  append_file() , read_bytes() , Stdio.File()->open()