C Language Development Kit/Functions/FindNext

From OptiWiki

Jump to: navigation, search
Description This function continues the search started with findfirst().
Syntax
int findnext(struct ffblk * ffblk);
Arguments
struct ffblk * ffblk
*ffblk is a pointer to a ffblk structure that is used to return the search result. The structure is defined as follows:
Returns
0 Success in finding *filename.
-1 No success in finding *filename.
Remarks None
Example
#include <stdio.h>
#include <stdlib.h>
#include "lib.h"
 
void main( void )
{
    struct ffblk  ffblk;
    int done;
 
    for(;;)
    {
        printf("\fDirectory  *.*\n");
        done = findfirst( "*.*",);
        while( !done )
        {
            printf("  %s.%s\n", ffblk.name, ffblk.ext);
            done = findnext(  );
            while( getchar() == EOF )
                idle();
        }
        printf("listing ready!");
        while( getchar() == EOF )
            idle();
    }
}


Views
Personal tools