中级会员
 
- 积分
- 223
- 金钱
- 223
- 注册时间
- 2015-7-9
- 在线时间
- 84 小时
|
发表于 2016-7-14 18:18:12
|
显示全部楼层
本帖最后由 gsp2000_2000 于 2016-7-14 18:21 编辑
文件系统中结构体定义
typedef struct {
FATFS* fs; /* Pointer to the related file system object (**do not change order**) */
WORD id; /* Owner file system mount ID (**do not change order**) */
BYTE flag; /* Status flags */
BYTE err; /* Abort flag (error code) */
DWORD fptr; /* File read/write pointer (Zeroed on file open) */
DWORD fsize; /* File size */
DWORD sclust; /* File start cluster (0:no cluster chain, always 0 when fsize is 0) */
DWORD clust; /* Current cluster of fpter (not valid when fprt is 0) */
DWORD dsect; /* Sector number appearing in buf[] (0:invalid) */
#if !_FS_READONLY
DWORD dir_sect; /* Sector number containing the directory entry */
BYTE* dir_ptr; /* Pointer to the directory entry in the win[] */
#endif
#if _USE_FASTSEEK
DWORD* cltbl; /* Pointer to the cluster link map table (Nulled on file open) */
#endif
#if _FS_LOCK
UINT lockid; /* File lock ID origin from 1 (index of file semaphore table Files[]) */
#endif
#if !_FS_TINY
BYTE buf[_MAX_SS]; /* File private data read/write window */
#endif
} FIL;
定义: FIL *file; f_open(file,"0:/***.txt",FA_CREATE_ALWAYS);
或者定义FIL file;
f_open(&file,"0:/***.txt",FA_CREATE_ALWAYS);
|
|