f_findnext


Use this function to find the next file or subdirectory in a specified directory after a previous call to f_findfirst() or f_findnext().

First call f_findfirst() and then, if a file is found, get the rest of the matching files by repeated calls to f_findnext(). Files with the system attribute set will be ignored.

Note: If this function is called with "*.*" and it is not the root directory, the first file found will be ".." - the parent directory.

Format

unsigned char f_findnext ( F_FIND * find )

Arguments

Argument Description Type
find The Find information (from f_findfirst()). F_FIND *

Return values

Return value Description
F_NOERR Successful execution.
Else See Error Codes.

Example

void mydir()
{
    F_FIND find;
    if (!f_findfirst( "/subdir/file*.*", &find ))
    {
        do
        {
            printf( "filename:%s", find.filename );
            if (find.attr&F_ATTR_DIR)
            {
                printf( " directory\n" );
            }
            else
            {
                printf( " size %d\n", find.filesize );
            }    
        }
        while (!f_findnext( &find ));
    }
}