Example code (I think it was using <dos.h>):
void fClearDir(char* sp)
{
char sf[250];
char *n;
DIR *dirp;
struct dirent *direntp;
dirp = opendir( sp );
if( dirp != NULL ) {
for(;;) {
direntp = readdir( dirp );
if( direntp == NULL ) break;
n=direntp->d_name;
if (strcmp(n,".")!=0 && strcmp(n,"..")!=0)
{
strcpy(sf,sp);strcat(sf,n);
remove(sf);
}
}
closedir( dirp );
}
}
I need a modern replacement of this (crossplatform Windows+Mac+Linux).