F_FILE * f_open( const char *pcFileName, const char *pcMode );
Opens a file in the FAT file system ready for reading or writing.
Parameters:
| pcFileName |
The name of the file being opened. The name is specified
as a standard null terminated C string.
|
||||||||||||||
| pcMode |
The mode in which the file will be opened. The following
values are valid:
There is no text mode. All files are treated as being binary.
|
| Null |
The file could not be opened.
|
| Any other value |
The returned value is the handle to the opened file.
|
See also
f_read(), f_write(), f_close().
Example usage:
void vSampleFunction( void ) { F_FILE *pxFile; char c; /* Open a file called afile.bin. */ pxFile = f_open( "afile.bin", "r" ); if( pxFile != NULL ) { /* * Access the file here using f_read(). */ /* Close the file when all accesses are complete. */ f_close( pxFile ); } } Example use of the f_open() API function