Gio.File.new_tmp
function new_tmp(tmpl: String): [return_value: Gio.File, iostream: Gio.FileIOStream] { // Gjs wrapper for g_file_new_tmp() }
Opens a file in the preferred directory for temporary files (as returned by GLib.get_tmp_dir) and returns a Gio.File and Gio.FileIOStream pointing to it.
tmpl should be a string in the GLib file name encoding containing a sequence of six 'X' characters, and containing no directory components. If it is null, a default template is used.
Unlike the other Gio.File constructors, this will return null if a temporary file could not be created.
Since 2.32
- tmpl
Template for the file name, as in GLib.file_open_tmp, or null for a default template
- return_value
a new Gio.File. Free the returned object with GObject.Object.prototype.unref.
- iostream
on return, a Gio.FileIOStream for the created file