mirror of
https://sourceware.org/git/glibc.git
synced 2024-12-21 18:30:05 +00:00
30 lines
386 B
C
30 lines
386 B
C
|
/*@group*/
|
||
|
#include <stdio.h>
|
||
|
#include <dirent.h>
|
||
|
/*@end group*/
|
||
|
|
||
|
static int
|
||
|
one (struct dirent *unused)
|
||
|
{
|
||
|
return 1;
|
||
|
}
|
||
|
|
||
|
int
|
||
|
main (void)
|
||
|
{
|
||
|
struct dirent **eps;
|
||
|
int n;
|
||
|
|
||
|
n = scandir ("./", &eps, one, alphasort);
|
||
|
if (n >= 0)
|
||
|
{
|
||
|
int cnt;
|
||
|
for (cnt = 0; cnt < n; ++cnt)
|
||
|
puts (eps[cnt]->d_name);
|
||
|
}
|
||
|
else
|
||
|
perror ("Couldn't open the directory");
|
||
|
|
||
|
return 0;
|
||
|
}
|