             <span class="c">/* Open the directory */</span>
    if (res == FR_OK) {
        nfile = ndir = 0;
        for (;;) {
            res = <em>f_readdir</em>(&amp;dir, &amp;fno);           <span class="c">/* Read a directory item */</span>
            if (fno.fname[0] == 0) break;          <span class="c">/* Error or end of dir */</span>
            if (fno.fattrib &amp; AM_DIR) {            <span class="c">/* It is a directory */</span>
                printf("   &lt;DIR&gt;   %s\n", fno.fn