Tutorial 17 - CleO File System

<< Click to Display Table of Contents >>

Navigation:  Tutorials >

Tutorial 17 - CleO File System

CleO File System allows controlling the way in which data is stored and retrieved. CleO uses FatFs which is a generic FAT file system module for small embedded systems. The FatFs module is written in compliance with ANSI C and completely separated from the disk I/O layer. Hence,  it is independent of the hardware architecture. The file name is a pointer to a null-terminated string that specifies the file name to create or open.

 

Note: CleO uses two types of storage, namely eFlash (external flash) and SD Card (Secure Digital card). For any file access from eFlash, the @ symbol must be used in the prefix for the file system operations. The eFlash supports up to 8MB storage, and SD card can support up to 32GB.

 

Here is a sample filename format -

 

"/dir1/dir2/test.txt"

"test"

"@/dir/file.txt"

 

This tutorial shows how to perform the file operations using the following commands -

 

FOpen()

This topic illustrates how to use the FOpen() command to open a file.

 

 

FClose()

This topic illustrates how to use the FClose() command to close a file.

 

 

FWrite()

This topic illustrates how to use the FWrite() command to write into a file.

 

 

FRead()

This topic illustrates how to use the FRead() command to read a file.

 

 

FSeek()

This topic illustrates how to perform the seek operation using the FSeek() command.

 

 

FGetC()

This topic illustrates how to read characters using the FGetC() command.

 

 

FTell()

This topic illustrates how to get the current read/write pointer of a file using the FTell() command.

 

 

FEOF()

This topic shows how to read the end of the file using the FEOF() command.

 

 

FSize()

 

This topic illustrates how to calculate the size of the file using the FSize() command.

 

 

FGetS()

 

This topic demonstrates how to read the string from a file using the FGetS() command.

 

 

FPutS()

 

This topic illustrates how to write a string to a file using the FPutS() command.

 

 

FPutC()

 

This topic shows how to write characters to a file using the FPutC() command.

 

 

FUnLink()

 

This topic shows how to delete file/directory using the FUnLink() command.

 

 

FStat()

 

This topic shows how the FStat() command is used for checking the existence of a file or directory.

 

 

FMKDir()

 

This topic shows how the FMKDir() command is used for creating a new directory.

 

 

FReadDir()

 

This topic shows how the FReadDir() command is used to read the data from the directory and sub-directory.