Hi I am using LPC1768 to store and read data from SD I have a folder called My1stFolder in which there is a second folder called my2ndFolder I create some files in M0:\My1stFolder\my2ndFolder and I'd like to read them later
Here is my code:
FINFO CheckFolder (void) { FINFO F_Info; retv=finit (NULL); F_Info.fileID = 0; while (ffind ("M0:*my2ndFolder*.txt", &F_Info) == 0) { SendString0("\r\n file name is:"); SendString0(F_Info.name); } funinit(NULL); retv=1; return F_Info; } void SendString0(char * Array) //send string to UART0 from SRAM { unsigned int i=0; for(i=0;i<strlen(Array);i++) sendchar0(Array[i]); }
The problem is when I use ffind to search for files in my2ndFolder and try to get the file names, F_Info.name returns the name of the first folder: My1stFolder instead of a complete name (for example M0:\My1stFolder\my2ndFolder\filename.txt) so I cannot get file name to open it
Any help would be extremely appreciated