FileUtils.fileSetContents

Writes all of contents to a file named filename, with good error checking. If a file called filename already exists it will be overwritten. This write is atomic in the sense that it is first written to a temporary Since 2.8

class FileUtils
static
int
fileSetContents
(
string filename
,
string contents
,)

Parameters

filename string

name of a file to write contents to, in the GLib file name encoding

contents string

string to write to the file

length gssize

length of contents, or -1 if contents is a nul-terminated string

Return Value

Type: int

TRUE on success, FALSE if an error occurred

Throws

GException on failure.

Meta