我看代码里面有,楼主看一下创建文件夹的代码有没有:
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);
我看代码里面有,楼主看一下创建文件夹的代码有没有:
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);
举报