Hardware How do I make directories on the 3DS?

HomebrewAddict

Member
OP
Newcomer
Joined
Jan 23, 2021
Messages
6
Trophies
0
Age
24
Location
/dev/urandom
XP
52
Country
Greece
I have tried this code:

#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>

struct stat st = {0};

if (stat("/3ds/Test/", &st) == -1) {
mkdir("/3ds/Test/", 0700);
}


It creates the directory but the app crashes instantly when I open it, I don't get any errors at compilation(It shows a Luma arm11 read error) and when I reopen it it doesn't crash. I know how to create files just not directories. Can anyone please help me? I can't find a why to make it not crash.
IMG-20210129-174353.jpg
 
Last edited by HomebrewAddict,

IC_

GBAtemp's ???
Member
Joined
Aug 24, 2017
Messages
1,571
Trophies
1
Location
The Forest
XP
5,508
Country
Antarctica
If the directory was created and the app crashes after that, are you sure the problem is not in a later part of the code? The stat part is also not necessary from my experience, it should still work when you always run the mkdir command.
 
  • Like
Reactions: Alexander1970

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    SylverReZ @ SylverReZ: https://www.youtube.com/watch?v=0UeJincEpEM