#include <dirent.h> int scandir( const char *dir, struct dirent ***namelist, int (*select)(const struct dirent *), int (*compar)(const struct dirent **, const struct dirent **) );
The scandir() function scans the directory dir, calling
select() on each directory entry. Entries for which select()
returns non-zero are stored in strings allocated via malloc(),
sorted using qsort() with the comparison function compar(),
and collected in array namelist which is allocated via malloc().
If select is NULL, all entries are selected.
The routine is implemented in Cygnus newlib.
Copyright © 1988-2004 OAR Corporation