/* Wrapper around the f_readdir() function which also returns ".." entry for sub-dirs. (FatFS 0.12 does not return ".", ".." dirs anymore)  */
FRESULT sdReadDir(DIR *dir, FILINFO *fno, bool &firstTime)
/* Wrapper around the f_readdir() function which also returns ".." entry for sub-dirs. (FatFS 0.12 does not return ".", ".." dirs anymore)  */
FRESULT sdReadDir(DIR *dir, FILINFO *fno, bool &firstTime)
{
  FRESULT res;
  if (firstTime && !isCwdAtRoot()) {
    strcpy(fno->fname, "..");
    fno->fattrib = AM_DIR;
    res = FR_OK;
  }
  else {
    res = f_readdir(dir, fno);
  }
  firstTime = false;
  return res;
}