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:

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;
}
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement