Skip to content

Instantly share code, notes, and snippets.

@lukas2511
Created November 24, 2014 16:10
Show Gist options
  • Save lukas2511/5246962e78ab553b616f to your computer and use it in GitHub Desktop.
Save lukas2511/5246962e78ab553b616f to your computer and use it in GitHub Desktop.
3ds: list files in directory
Handle dirHandle;
FS_path dirPath=FS_makePath(PATH_CHAR, "/");
FSUSER_OpenDirectory(NULL, &dirHandle, sdmcArchive, dirPath);
u32 entriesRead=0;
do {
u16 entryBuffer[512];
char data[256];
FSDIR_Read(dirHandle, &entriesRead, 1, (FS_dirent*)entryBuffer);
if(!entriesRead){
print("END");
break;
}
unicodeToChar(data, entryBuffer);
print(" - ");
print(data);
print("\n");
}while(entriesRead>0);
FSUSER_CloseArchive(NULL, &sdmcArchive);
fsExit();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment