Chinaunix首页 | 论坛 | 博客
  • 博客访问: 452993
  • 博文数量: 155
  • 博客积分: 786
  • 博客等级: 军士长
  • 技术积分: 1561
  • 用 户 组: 普通用户
  • 注册时间: 2012-09-01 23:37
个人简介

在路上

文章分类

全部博文(155)

文章存档

2016年(2)

2015年(36)

2014年(45)

2013年(34)

2012年(38)

我的朋友

分类: 嵌入式

2014-05-19 19:45:40


当调用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

fsize

Indicates size of the file in unit of byte. Always zero for directories.

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)

fattrib

Indicates the file/directory attribute in combination of AM_DIR, AM_RDO, AM_HID, AM_SYS and AM_ARC.

fname[]

Indicates the file/directory name in 8.3 format null-terminated string. It is always returnd with upper case on non-LFN configuration but it can be returned with lower case on LFN configuration.

lfname    长文件名:存放地址

Pointer to the LFN buffer to store the read LFN. This member must be initialized by application prior to use this structure. Not available on non-LFN configuration.

lfsize

Size of the LFN buffer in unit of TCHAR. This member must be initialized by application prior to use this structure. Not available on non-LFN configuration.

 


阅读(1744) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~