Created
April 10, 2019 23:31
-
-
Save thrimbor/33386186df27241a724022d28c5759fd to your computer and use it in GitHub Desktop.
List files with NXDK
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <xboxrt/debug.h> | |
#include <pbkit/pbkit.h> | |
#include <hal/xbox.h> | |
#include "stdio.h" | |
#include <hal/fileio.h> | |
void main(void) | |
{ | |
int i; | |
switch(pb_init()) | |
{ | |
case 0: break; | |
default: | |
XSleep(2000); | |
XReboot(); | |
return; | |
} | |
pb_show_debug_screen(); | |
XBOX_FIND_DATA findData; | |
unsigned int handle = XFindFirstFile("C:\\", "*", &findData); | |
if (handle == INVALID_HANDLE_VALUE) | |
debugPrint("oh noes!\n"); | |
while (handle != INVALID_HANDLE_VALUE) | |
{ | |
debugPrint("file: %s\n", findData.cFileName); | |
int result = XFindNextFile(handle, &findData); | |
if (result == ERROR_NO_MORE_FILES) { | |
XFindClose(handle); | |
break; | |
} | |
} | |
debugPrint("\ndone\n"); | |
while(1) { | |
XSleep(2000); | |
} | |
pb_kill(); | |
XReboot(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment