RTEMS Logo

RTEMS 4.10.2 On-Line Library


Files and Directories Manager scandir - Scan a directory for matching entries

PREV UP NEXT Bookshelf RTEMS POSIX API User's Guide

4.4.4: scandir - Scan a directory for matching entries

CALLING SEQUENCE:

#include <dirent.h>

int scandir(
  const char       *dir,
  struct dirent ***namelist,
  int  (*select)(const struct dirent *),
  int  (*compar)(const struct dirent **, const struct dirent **)
);

STATUS CODES:

ENOMEM
Insufficient memory to complete the operation.

DESCRIPTION:

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.

NOTES:

The routine is implemented in Cygnus newlib.


PREV UP NEXT Bookshelf RTEMS POSIX API User's Guide

Copyright © 1988-2008 OAR Corporation