对FatFs文件系统没有仔细研究,只是移植到板子上并可以使用了。可以根据输入的名字在SD卡种创建文件夹,我现在想用时间来命名txt文件,可是怎么都建立不了,请教大神fatfs那块需要配置嘛?
h_Time = Time_GetCalendarTime(); Time_GetTimeString(&h_Time,_HMSstr,Show_HMS);
Time_GetTimeString(&h_Time,_YMDstr,Show_YMD);
printf("%s\r\n",_HMSstr);
/* 创建文件夹 */
f_mkdir(filename);
/* 在创建的文件夹中创建TXT文件 */
strcat(txtname,filename);
strcat(txtname,"/");
strcat(txtname,_HMSstr); //——HMSstr是存放时间的字符串
strcat(txtname,".TXT");
f_open(&file,txtname,FA_CREATE_NEW | FA_WRITE ); //创建txt文件
f_write(&file, RS_Buffer, sizeof(RS_Buffer), &bw1);
f_close(&file);
求大神指点???
|