[ CCode ( cname = "g_mkstemp" ) ]
public int mkstemp (string tmpl)

Opens a temporary file.

See the mkstemp documentation on most UNIX-like systems.

The parameter is a string that should follow the rules for mkstemp templates, i.e. contain the string "XXXXXX". mkstemp is slightly more flexible than mkstemp in that the sequence does not have to occur at the very end of the template. The X string will be modified to form the name of a file that didn't exist. The string should be in the GLib file name encoding. Most importantly, on Windows it should be in UTF-8.



template filename


A file handle (as from open) to the file opened for reading and writing. The file is opened in binary mode on platforms where there is a difference. The file handle should be closed with close. In case of errors, -1 is returned and errno will be set.

Namespace: GLib.FileUtils
Package: glib-2.0