This repository has been archived on 2024-12-16. You can view files and clone it, but cannot push or open issues or pull requests.
CodeBlocksPortable/WATCOM/samples/clibexam/opendir.c

23 lines
370 B
C
Raw Permalink Normal View History

#include <stdio.h>
#include <direct.h>
void main()
{
DIR *dirp;
struct dirent *direntp;
dirp = opendir( "\\watcom\\h" );
if( dirp == NULL ) {
perror( "" );
} else {
for(;;) {
direntp = readdir( dirp );
if( direntp == NULL ) break;
printf( "%s\n", direntp->d_name );
}
closedir( dirp );
}
}