/*
This program prints names of all files in the current directory.
The program is portable in Ch and can run in Unix/Linux/Windows.
*/
#include <stdio.h>
#include <dirent.h>
int main() {
DIR *dirp;
struct dirent *direntp;
dirp = opendir( "." );
while ( (direntp = readdir( dirp )) != NULL )
{
printf( "%s\n", direntp->d_name );
}
closedir( dirp );
return (0);
}