请问FATFS创建文件夹时如何添加创建时间?

2019-07-14 15:14发布

如题!
通过实现get_fattime函数创建文件时是可以添加“创建时间”的,但是创建文件夹时却不能,请各位帮忙,谢谢!
另外,f_utime添加的是“修改时间”
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
4条回答
TOPCB
2019-07-15 02:45
我看代码里面有,楼主看一下创建文件夹的代码有没有:
if (res == FR_OK) res = dir_register(&dj);        /* Register the object to the directoy */
                        if (res != FR_OK) {
                                remove_chain(dj.fs, dcl);                        /* Could not register, remove cluster chain */
                        } else {
                                dir = dj.dir;
                                dir[DIR_Attr] = AM_DIR;                                /* Attribute */
                                ST_DWORD(dir + DIR_WrtTime, tm);        /* Created time */
                                st_clust(dir, dcl);                                        /* Table start cluster */
                                dj.fs->wflag = 1;
                                res = sync_fs(dj.fs);

一周热门 更多>