|
我使用的是MDK-Middleware 7.12,FileSystem 6.13.8
使用filesystem管理Nand,在创建文件时,使用了ftime_set()函数,但是,在使用ftime_get()函数时,发现读取出来的时间不正确
请问有使用过此功能的同仁吗?可以指导一二吗?
- FileErrCode_t TeachingFile::creat(const char* fn)
- {
- fsFileInfo info{};
- FILE* f = null;
- FileList_t list = { 0 };
-
- info.fileID = 0;
- if (ffind(fn, &info) == fsOK)
- {
- return FILE_EXIST;
- }
- f = fopen(fn, "wb+");
- if (f == null)
- {
- return FILE_ERROR;
- }
- else
- {
- char s[] = "test sting";
- fwrite(s, sizeof(uint8_t), sizeof"test sting" - 1, f);
- stat=fs_get_time(&time1);
- stat=ftime_set(fn, &time1, &time1, &time1);
- fclose(f);
- info.fileID = 0;
- stat=ftime_get(fn, &cTime, &aTime, &wTime);
- ffind(fn, &info);
-
- f = null;
- strcpy(list.fn, fn);
- list.size = 0;
- // TODO: add fsTime
- rtc.getTime(&list.time);
- _fileList.push_back(&list);
- }
- return FILE_SUCCESS;
- }
复制代码
|
|