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
268
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
31
XP
68
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

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • K3Nv2 @ K3Nv2:
    Ryzen based 5700U can do cyberpunk at 30fps on like low everything
  • HiradeGirl @ HiradeGirl:
    What if I want Ultra everything?
  • K3Nv2 @ K3Nv2:
    You'll look at $1400
    +1
  • BigOnYa @ BigOnYa:
    $1000+
  • K3Nv2 @ K3Nv2:
    Google the laptops graphic chip for games streaming more then likely benched on YouTube
  • HiradeGirl @ HiradeGirl:
    That's a lot of money.
  • HiradeGirl @ HiradeGirl:
    I can pay it, but I'd rather eat better.
  • K3Nv2 @ K3Nv2:
    Nah just eat floor crumbs
  • HiradeGirl @ HiradeGirl:
    Juan's floor crumbs were always rat fur
    +1
  • BigOnYa @ BigOnYa:
    Change from real cheese, to government cheese, you'll save some money.
    +1
  • K3Nv2 @ K3Nv2:
    Gotta get that government cheese one new laptop a year
    +1
  • K3Nv2 @ K3Nv2:
    Fucking Biden making us pay full internet prices
    +1
  • BigOnYa @ BigOnYa:
    Of course there is always, OnlyFans, or a GoFundMe, to raise some money.
  • HiradeGirl @ HiradeGirl:
    @BigOnYa are you on OnlyFans?
  • K3Nv2 @ K3Nv2:
    He gets his ramming funds from onlyfans
  • BigOnYa @ BigOnYa:
    Yea but my total income is negative, lol
  • HiradeGirl @ HiradeGirl:
    I would pay for watching someone eat food from the floor.
  • Xdqwerty @ Xdqwerty:
    @BigOnYa, stop spending the videos' budget on food
  • BigOnYa @ BigOnYa:
    No I've never even been to the site(honestly) but have heard of it
  • K3Nv2 @ K3Nv2:
    I'm half way at my savings for a new move
  • BigOnYa @ BigOnYa:
    Like a karate move? The flying dragon is cool.
  • HiradeGirl @ HiradeGirl:
    @BigOnYa if you've never been to the site how do you know about its contents?
  • Xdqwerty @ Xdqwerty:
    Can he do a shoryuken?
  • Xdqwerty @ Xdqwerty:
    @HiradeGirl, cuz of people mentioning it everywhere
    Xdqwerty @ Xdqwerty: @HiradeGirl, cuz of people mentioning it everywhere