扩展:
http://elm-chan.org/fsw/ff/00index_e.html
FATFS文件系统源码分析:http://wenku.baidu.com/view/bcef50de7f1922791688e8f9.html
程序员玩耍的小窝(讲解fatfs指令):http://www.forwhat.cn/post-205.html
FATFS文件系统源码分析:http://wenku.baidu.com/view/bcef50de7f1922791688e8f9.html
程序员玩耍的小窝(讲解fatfs指令):http://www.forwhat.cn/post-205.html
特点
FAT12, FAT16 与 FAT32.多个卷(物理
驱动器与分区).两种分区规则: FDISK 与 Super-floppy.多种配置选项:
长文件名支持。可选的编码页,包括
DBCS(译者:DBCS为双位
元组字元系统 Double Byte Char Systems )多任务支持只读,最小化API,缓冲区配置等等
应用程序接口
FatFs 提供下面的函数:
f_mount - 注册/注销一个工作区域(Work Area)
f_open - 打开/创建一个文件f_close - 关闭一个文件
f_read - 读文件f_write - 写文件
f_lseek - 移动文件读/写指针
f_truncate - 截断文件
f_sync - 冲洗缓冲数据 Flush Cached Data
f_opendir - 打开一个目录
f_readdir - 读取目录条目
f_getfree - 获取空闲簇 Get Free Clusters
f_stat - 获取文件状态
f_mkdir - 创建一个目录
f_unlink - 删除一个文件或目录
f_chmod - 改变属性(
Attribute)
f_utime - 改变
时间戳(Timestamp)
f_rename - 重命名/移动一个文件或文件夹
f_mkfs - 在
驱动器上创建一个文件系统
f_forward - 直接转移文件数据到一个数据流 Forward file data to the stream directly
f_gets - 读一个字符串
f_putc - 写一个字符
f_puts - 写一个字符串
f_printf - 写一个格式化的字符
磁盘I/O接口
Since the FatFs module is completely separated from disk
I/O layer, it requires following functions to lower layer to read/write physical disk and to get current time. The low level disk I/O module is not a part of FatFs module and it must be provided by user. The sample drivers are also available in the resources.
disk_initialize - Initialize disk drive 初始化
磁盘驱动器
disk_status - Get disk status 获取磁盘状态
disk_read - Read sector(s) 读扇区
disk_write - Write sector(s) 写
扇区
disk_ioctl - Control device dependent features 设备相关的控制特性
get_fattime - Get current time 获取当前时间