FatFS中的FILINFO介绍
当调用FatFS中的f_readdir函数返回FILINFO值的时候,大家如果直接看FILINFO里面的值可能看不懂。因为里面的值需要大家转换一下,FILINFO的具体格式如下:
The FILINFO structure holds a file information returned by f_stat and f_readdir function.
typedef struct { DWORD fsize; /* File size */ WORD fdate; /* Last modified date */ WORD ftime; /* Last modified time */ BYTE fattrib; /* Attribute */ TCHAR fname[13]; /* Short file name (8.3 format) */#if _USE_LFN TCHAR* lfname; /* Pointer to the LFN buffer */ int lfsize; /* Size of the LFN buffer in unit of TCHAR */#endif} FILINFO;Members
- fsizeIndicates size of the file in unit of byte. Always zero for directories.fdateIndicates the date that the file was modified or the directory was created.
- bit15:9Year origin from 1980 (0..127)bit8:5Month (1..12)bit4:0Day (1..31)
- bit15:11Hour (0..23)bit10:5Minute (0..59)bit4:0Second / 2 (0..29)