freopen

fnvoid * freopen(string filename, string mode, void * stream = null)

A wrapper for the POSIX freopen() function. The freopen() function opens a file and associates it with an existing stream.

See your C library manual for more details about freopen().

Parameters

filenamea pathname in the GLib file name encoding (UTF-8 on Windows)
modea string describing the mode in which the file should be opened
streaman existing stream which will be reused, or null

Returns

A FILE* if the file was successfully opened, or null if

an error occurred.