Fatfs create folders
Hi All,
I am currently working on creating a file system on an stm32f207, using the nucleo board for the time being while I wait for my custom boards.
The board will have an SD card as well as a USB.
I have made a simple function for creating a folder onto a drive:
FRESULT f_CreateFolder( const TCHAR* path){
FRESULT fr;
// Create folder/directory
fr = f_mkdir(path);
if(fr == FR_OK){
// Success
// TODO: f_mkdir Something to happen when successful
}
else{
// Error
// TODO: f_CreateFolder make directory error
}
return fr;
} // END f_CreateFolderthe "f_mdir" has no calls to which drive it is referring to, so if both SD and USB are mounted, how do I choose which drive to create a folder on??
Finally, I have been succesful with creating a single folder on the SD (yet to try on USB but I can't imagine it being any different) but I am not sure how to create folders within folders, if that makes sense lol.
This works to create folders in the root directory:
// Mount SD Card
f_MountDisk(&SDCard, &SDFatFS, SDPath);
HAL_Delay(100);
f_CreateFolder("INIT");
HAL_Delay(100);
f_CreateFolder("CONFIG");
HAL_Delay(100);
f_CreateFolder("LOGS");
HAL_Delay(100);How can I create folders inside the folders created above, for example have another folder in "LOGS" for specific dates.
Thanks in advance all!! =)
