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/readdir.c

21 lines
337 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 ) {
for(;;) {
direntp = readdir( dirp );
if( direntp == NULL ) break;
printf( "%s\n", direntp->d_name );
}
closedir( dirp );
}
}