So I am trying to read files in a directory using this code(for gint, but since it's using syscalls, pretty sure it would work with prizmsdk with some little changes)
I found a code that worked fine(https://gitea.planet-casio.com/Lephenixnoir/gintctl/src/branch/dev/src/libs/bfile.c)... Only when dealing with the root directory!
so for example using
\\fls0\* would work just fine
but \\fls0\test\* (also test exists)
just returns me 2 files/folders named . and .. (even though there's 6 files in it)
EDIT: Fixed it
Code:
I found a code that worked fine(https://gitea.planet-casio.com/Lephenixnoir/gintctl/src/branch/dev/src/libs/bfile.c)... Only when dealing with the root directory!
so for example using
\\fls0\* would work just fine
but \\fls0\test\* (also test exists)
just returns me 2 files/folders named . and .. (even though there's 6 files in it)
EDIT: Fixed it
Code:
int explore_folder(uint16_t* search, uint16_t names[MAX_FILES][MAX_CHARACTERS], struct BFile_FileInfo infos[MAX_FILES]) {
/* Search descriptor */
int sd = 0;
/* Number of files found */
int found = 0;
int rc = BFile_FindFirst(search, &sd, names[found], &infos[found]);
if(rc < 0) return rc;
while(((rc = BFile_FindNext(sd, names[found], &infos[found])) != -16) && ((found++) < MAX_FILES));
BFile_FindClose(sd);
return found;
}