MicrOS
freopen.c File Reference
#include "../stdio.h"

Functions

FILEstreams_set_stream_as_file (const char *, const char *, FILE *)
 
FILEfreopen (const char *filename, const char *mode, FILE *stream)
 Reopen stream with different file or mode. More...
 

Function Documentation

◆ freopen()

FILE* freopen ( const char *  filename,
const char *  mode,
FILE stream 
)

Reopen stream with different file or mode.

Reuses stream to either open the file specified by filename or to change its access mode. If filename is a null pointer, the function attempts to change the mode of the stream.

Parameters
filenameC string containing the name of the file to be opened.
modeC string containing a file access mode (r, w, a, r+, w+, a+).
streamPointer to a FILE object that identifies the stream to be reopened.
Returns
If the file is successfully reopened, the function returns the pointer passed as parameter stream, which can be used to identify the reopened stream. Otherwise, a null pointer is returned.

◆ streams_set_stream_as_file()

FILE* streams_set_stream_as_file ( const char *  ,
const char *  ,
FILE  
)