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

Functions

FILEstreams_set_stream_as_file (const char *filename, const char *mode, FILE *stream)
 
FILEfopen (const char *filename, const char *mode)
 Open file. More...
 

Function Documentation

◆ fopen()

FILE* fopen ( const char *  filename,
const char *  mode 
)

Open file.

Opens the file whose name is specified in the parameter filename and associates it with a stream that can be identified in future operations by the FILE pointer returned. The returned stream is fully buffered by default.

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+).
Returns
If the file is successfully opened, the function returns a pointer to a FILE object that can be used to identify the stream on future operations. Otherwise, a null pointer is returned.

◆ streams_set_stream_as_file()

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