![]() |
Morse Micro IoT SDK
2.9.7
|
Example file I/O application using standard C API.
fileio.c is an example application that demonstrates how to use standard C file I/O routines to access files. We use standard POSIX open(), close(), read() and write() function calls to open, close, read and write to files. Other functions supported are lseek(), mkdir() and remove(). Yes, sub-directories are supported. For details on these functions see their definitions in sys/unistd.h. If the platform does not support file I/O then calling these functions will return an error. See sys/errno.h for a list of possible error codes that will be returned in errno.
The file I/O module is automatically included and initialized in the application binary only if open() is called from the application. This saves space in applications that do not use this functionality.
Definition in file fileio.c.
#include <stdio.h>#include <sys/unistd.h>#include <sys/fcntl.h>#include <sys/errno.h>
Go to the source code of this file.
Functions | |
| void | app_init (void) |
| Main entry point to the application. More... | |