Homebrew How do I create a folder in a homebrew program?

JackMacWindows

Well-Known Member
OP
Newcomer
Joined
Jan 16, 2016
Messages
53
Trophies
0
XP
247
Country
United States
Hello,
I know this seems like a stupid question, but I am wondering how I can make a directory from a homebrew program. I am writing a program that installs homebrew from zip files, but I need to know how to create a directory to install most 3DSX files. I saw FSUSER_CreateDirectory() in the libctru docs, but that mentions archives which I'm not sure about.

JackMacWindows
 

teseting

Member
Newcomer
Joined
Dec 17, 2016
Messages
10
Trophies
0
Age
29
XP
48
Country
United States
Do it the easy way and use
Code:
 mkdir("/dir", 0777);
also include
Code:
#include <dirent.h> // for more io features or you could just include <sys/stat.h> or <sys/iosupport.h>
but if you want to do more IO stuff you should probably know how to properly
Code:
 FS_Archive sdArch;// you want to reuse this so keep it
Result Res = FSUSER_OpenArchive(&sdArch, ARCHIVE_SDMC, fsMakePath(PATH_EMPTY, ""));
FSUSER_CreateDirectory(sdArch, fsMakePath(PATH_ASCII, path), 0);
also just learn from other people as the code above was copied directly from
https://github.com/J-D-K/JKSM/blob/e2b30c51c9c36a3289f8dd7584bd0ec18b9e5c48/source/sys.cpp
 
Last edited by teseting,
  • Like
Reactions: Mythical
General chit-chat
Help Users
    KenniesNewName @ KenniesNewName: I kind of feel like at this point they've done all they can with 3ds ports