没有直接的函数,需要用到`f_stat`获取文件状态后,从间接返回的数据结构类型FILINFO 信息中提取。函数的介绍如下:
```
FRESULT f_stat (
const XCHAR* FileName /@@* 文件名或目录名的指针 */
FILINFO* FileInfo /@@* FILINFO结构的指针 */
);
```
其中FILINFO的定义见下:
```
/@@* File information structure (FILINFO) */
typedef struct {
FSIZE_t fsize; /@@* File size */
WORD fdate; /@@* Modified date */
WORD ftime; /@@* Modified time */
BYTE fattrib; /@@* File attribute */
#if FF_USE_LFN
TCHAR altname[FF_SFN_BUF + 1];/@@* Altenative file name */
TCHAR fname[FF_LFN_BUF + 1]; /@@* Primary file name */
#else
TCHAR fname[12 + 1]; /@@* File name */
#endif
} FILINFO;
```
其中 fdate和ftime部分就是文件最后编辑时间信息(对目录是创建)。
分别的格式定义为
fdate:Indicates the date that the file was modified or the directory was created.
bit15:9
Year origin from 1980 (0..127)
bit8:5
Month (1..12)
bit4:0
Day (1..31)
ftime:Indicates the time that the file was modified or the directory was created.
bit15:11
Hour (0..23)
bit10:5
Minute (0..59)
bit4:0
Second / 2 (0..29)
没有直接的函数,需要用到`f_stat`获取文件状态后,从间接返回的数据结构类型FILINFO 信息中提取。函数的介绍如下:
```
FRESULT f_stat (
const XCHAR* FileName /@@* 文件名或目录名的指针 */
FILINFO* FileInfo /@@* FILINFO结构的指针 */
);
```
其中FILINFO的定义见下:
```
/@@* File information structure (FILINFO) */
typedef struct {
FSIZE_t fsize; /@@* File size */
WORD fdate; /@@* Modified date */
WORD ftime; /@@* Modified time */
BYTE fattrib; /@@* File attribute */
#if FF_USE_LFN
TCHAR altname[FF_SFN_BUF + 1];/@@* Altenative file name */
TCHAR fname[FF_LFN_BUF + 1]; /@@* Primary file name */
#else
TCHAR fname[12 + 1]; /@@* File name */
#endif
} FILINFO;
```
其中 fdate和ftime部分就是文件最后编辑时间信息(对目录是创建)。
分别的格式定义为
fdate:Indicates the date that the file was modified or the directory was created.
bit15:9
Year origin from 1980 (0..127)
bit8:5
Month (1..12)
bit4:0
Day (1..31)
ftime:Indicates the time that the file was modified or the directory was created.
bit15:11
Hour (0..23)
bit10:5
Minute (0..59)
bit4:0
Second / 2 (0..29)
举报