Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
#include <stdio.h>
#include <sys/types.h>
#include <dirent.h>
main()
{
struct dirent *dr;
DIR *dp = opendir(".");
if ( dp != NULL ) {
while ( (dr=readdir(dp)) != NULL ) {
printf( "%s\n", dr->d_name );
}
closedir( dp );
}
return 0;
}
char filearray [5000] [513];
int ScanDir (char *dir)
{
// This function scans a directory for all files.
// Loads the filearray
struct ffblk ffblk;
int done;
int x = 0;
char *buff = new char [512];
strcpy(buff, dir);
strcat(buff, "*.*");
done = findfirst(buff, &ffblk, FA_DIREC + FA_SYSTEM + FA_HIDDEN + FA_RDONLY + FA_ARCH);
while(!done)
{
if(strcmp(".", ffblk.ff_name) != 0 && strcmp("..", ffblk.ff_name) != 0)
{
if((ffblk.ff_attrib & FA_DIREC) == FA_DIREC);
else
{
strcpy (filearray [x], ffblk.ff_name);
x++;
}
}
done = findnext(&ffblk);
}
delete buff;
return x;
}