Classes | |
class | miosix::Directory |
Enumerations | |
enum | miosix::Attrib { miosix::READ_ONLY = 0x01, miosix::HIDDEN = 0x02, miosix::SYSTEM = 0x04, miosix::VOLUME_ID = 0x08, miosix::DIRECTORY = 0x10, miosix::ARCHIVE = 0x20 } |
Functions | |
char | miosix::mount_filesystem () |
void | miosix::umount_filesystem () |
bool | miosix::is_filesystem_mounted () |
File handling will not be described here since it is done using the C or C++ standard library (fopen, fprintf, istream, remove, mkdir, ...).
All file related function of the C and C++ standard library should work, except rename() and link() which are not implemented.
The maximum number of files that can be opened at the same time is defined in the constant MAX_OPEN_FILES in miosix_settings.h, and the defaut value is 4 All files are opened in binary mode. Therefore there is no differnce between fopen("file.txt","r") and fopen("file.txt","rb").
Directory listing is not done using the standard opendir() and readdir() functions, but using the Directory class.
is_filesystem_mounted() can be used to see if the filesystem is mounted before using file related functions.
The remaining functions described here are to mount/unmount the filesystem, which are not likely to be used by user code, since filesystem is mounted automatically at boot time, except in case of errors (like no uSD card in the socket).
enum miosix::Attrib |
File attribures, as returned by Directory::next(). More flags can be set at the same time
bool miosix::is_filesystem_mounted | ( | ) |
Returns true if the filesystem is mounted.
char miosix::mount_filesystem | ( | ) |
Try to mount the flesystem. Might take a long time (~ 1 sec if no errors, up to 3 sec in case of errors)
void miosix::umount_filesystem | ( | ) |
Umounts the filesystem if it is mounted. Please close all files before unmounting filesystem. Allows safely removing the SD card.