当前位置: 技术问答>linux和unix
unix下有没有象windows中的findfirst,findnext那样的函数?
来源: 互联网 发布时间:2015-05-19
本文导语: unix下有没有象windows中的findfirst,findnext那样的函数? | man scandir NAME scandir, alphasort, versionsort - scan a directory for matching entries SYNOPSIS #include int scandir(const char *dir, ...
unix下有没有象windows中的findfirst,findnext那样的函数?
|
man scandir
NAME
scandir, alphasort, versionsort - scan a directory for matching entries
SYNOPSIS
#include
int scandir(const char *dir, struct dirent ***namelist,
int(*select)(const struct dirent *),
int(*compar)(const struct dirent **, const struct dirent **));
int alphasort(const void *a, const void *b);
int versionsort(const void *a, const void *b);
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.
NAME
scandir, alphasort, versionsort - scan a directory for matching entries
SYNOPSIS
#include
int scandir(const char *dir, struct dirent ***namelist,
int(*select)(const struct dirent *),
int(*compar)(const struct dirent **, const struct dirent **));
int alphasort(const void *a, const void *b);
int versionsort(const void *a, const void *b);
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.
|
grep