File and Path Function
FILE * freopen(const char *path, const char *mode, FILE *stream);
FILE *_wfreopen(const wchar_t *path, const wchar_t *mode, FILE *stream);
FILE *_tfreopen(const TCHAR *path, const TCHAR *mode, FILE *stream);
Internationalization (I18n) Function Overview
The freopen function is like a combination of fclose and fopen .
It first closes the stream referred to by stream , ignoring any errors that are detected in the process.
(Because errors are ignored, you should not use freopen on an output stream if you have actually done any output using the stream.)
Then, like fopen , the file named by path is opened with the access permission indicated by mode , and associated with the same stream object,
stream . If successful, the stream object is returned; otherwise NULL is
returned to indicate an error.
On Windows platforms, _wfreopen is the wide-character version of freopen ; its arguments are wide-character strings. There is no ANSI wide-character equivalent.
_tfreopen is the Windows-only Generic version of the function; with the _MBCS or _UNICODE compiler flags determining its mapping to either freopen or _wfreopen .
I18n Issues
Use the appropriate version of the function as required for internationalization support.
On ANSI UTF-16 platforms, use a conversion function to convert the
wide-character strings to multibyte-character strings and then call freopen .
See Pathnames for a discussion of path and filename considerations in
an internationalized application, and File I/O, which addresses reading and
writing non-ASCII text data files.
Recommended Replacements*
*If you're already using the recommended function, see I18n Issues for other reasons why Globalyzer is detecting the function.
File and Path Functions
|