PRODUCT : Borland C++ NUMBER : 1710 VERSION : All OS : DOS Windows DATE : October 25, 1993 PAGE : 1/1 TITLE : Using findfirst with the FA_DIREC attribute /* Problem: When using findfirst with the FA_DIREC attribute, I get regular DOS files in addition to the directories. How do I get just the directories? Solution: Using FA_DIREC doesn't mean *only* return directories; it means include directories along with regular files. The solution is to check each ffblk found against the FA_DIREC attribute. */ #include #include #include int main (void) { struct ffblk fb; int done; printf ("Directories found:\n"); done = findfirst ("*.*", &fb, FA_DIREC); while (!done) { if (fb.ff_attrib & FA_DIREC) printf ("%s\n", fb.ff_name); done = findnext (&fb); } return 0; } DISCLAIMER: You have the right to use this technical information subject to the terms of the No-Nonsense License Statement that you received with the Borland product to which this information pertains.