Morse Micro IoT SDK  2.9.7
fileio.c File Reference

Detailed Description

Example file I/O application using standard C API.

Note
It is assumed that you have followed the steps in the Getting Started guide and are therefore familiar with how to build, flash, and monitor an application using the MM-IoT-SDK framework.

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>
Include dependency graph for fileio.c:

Go to the source code of this file.

Functions

void app_init (void)
 Main entry point to the application. More...
 

Function Documentation

◆ app_init()

void app_init ( void  )

Main entry point to the application.

This will be invoked in a thread once operating system and hardware initialization has completed. It may return, but it does not have to.

Definition at line 37 of file fileio.c.