SYNOPSIS
#include <dirent.h>
int scandir(const char *dirname, struct dirent ***namelist, int (*select)(struct dirent *), int (*compar)(const void *, const void *));
int scandir64(const char *dirname, struct dirent64 ***namelist, int (*select)(struct dirent64 *), int (*compar)(const void *, const void *));
DESCRIPTION
The
select is a pointer to a routine which is called with a pointer
to a directory entry and should return a non-zero value if the directory
entry should be included in the array pointed to by namelist.
If select is NULL, all the directory entries are
included. The last argument compar is a pointer to a routine
which is passed to
The
PARAMETERS
- dirname
-
Is the name of the directory that
scandir() reads. - namelist
-
Points to an array of structure pointers.
- select
-
Points to a routine that is called with a pointer to a directory entry. If the directory entry is to be included in the array, select returns a non-zero value.
- compar
-
Points to a routine that is passed to
qsort() to sort the completed array. If this pointer is NULL, the array is not sorted.
RETURN VALUES
If successful,
CONFORMANCE
4.4BSD.
MULTITHREAD SAFETY LEVEL
MT-Safe.
PORTING ISSUES
None.
AVAILABILITY
PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition
SEE ALSO
- Functions:
alphasort() ,closedir() ,malloc() ,opendir() ,qsort() ,readdir()
- Miscellaneous:
- lf64
PTC MKS Toolkit 10.4 Documentation Build 39.