I've write some code to test writefile function:
for(x=0;x<30;x++)
{
UTIL_uint2str( rstr, x, 3, 1);
strcpy(CurrentPath, "test");
strcat(CurrentPath, rstr);
strcat(CurrentPath, SUFF_FILE);
fprintf(&uart1_stream, "Current File: ");
fprintf(&uart1_stream, "%s\n", CurrentPath );
if (FS_OpenFile(&volume_info, CurrentPath, FS_WRITE, &file_info))
{
fprintf(&uart1_stream,"\n Err op: File");
}
FS_WriteFile(&file_info, "hello world!!!\r\n", &successcount, 16);
// FS_Close(&file_info); not necessary...
}
At the end of this code execution I get only test029.REC file ...
It seems that file test000.REC to test028.REC have been replaced by subsequential
new file creations up to last creation test029.REC.
May be that dosfs has some bug?
I've try some different sd but the problem is the same one.
Can anyone help me to understand?