Code: Select all
DIR *pdir = NULL;
pdir = opendir(".");
struct dirent *pent = NULL;
if (pdir == NULL)
{
printf("opendir() failed");
exit(3);
}
while(pent == readdir(pdir))
{
if (pent == NULL)
{
printf("readdir() failed");
exit(3);
}
printf(pent -> d_name);
}
closedir(pdir);
Code: Select all
#include <nds.h>
#include <fat.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <dirent.h>