set_data


Description:

[ CCode ( cname = "g_file_set_contents" ) ]
public bool set_data (string filename, uint8[] contents) throws FileError

Writes all of contents to a file named filename.

This is a convenience wrapper around calling set_contents_full with `flags` set to `G_FILE_SET_CONTENTS_CONSISTENT | G_FILE_SET_CONTENTS_ONLY_EXISTING` and `mode` set to `0666`.

Parameters:

filename

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

contents

string to write to the file

length

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

Returns:

true on success, false if an error occurred


Namespace: GLib.FileUtils
Package: glib-2.0