res = f_mount(&fs,"0:",1);
res = f_opendir(&dir, "0:4");
if (res == FR_OK)
{
while (((res = f_readdir(&dir, &fileInfo)) == FR_OK) && fileInfo.fname[0])
{
nFiles++;
}
}
f_closedir(&dir);