Homebrew Homebrew Development

Joel16

Ils ne passeront pas
Member
Joined
May 8, 2011
Messages
933
Trophies
2
Age
27
Location
Doesn't concern you.
XP
5,258
Country
United States
so I tried this code:
Code:
FS_Path testDir = (FS_Path){PATH_ASCII, 20, "sdmc:/3ds/ROT_Data/"};
FSUSER_DeleteDirectoryRecursively(ARCHIVE_SDMC, testDir);
it doesn't work... there aren't any compiler error's but it doesn't work. Although a small side note is, the starting { in the first line has the red line under it in visual studio and says: expected an expression.
Any ideas?

Remove the '/' at the end.

Code:
FSUSER_DeleteDirectoryRecursively(ARCHIVE_SDMC, fsMakePath(PATH_ASCII, "sdmc:/3ds/ROT_Data"));
 

Magicrafter13

Well-Known Member
Member
Joined
Feb 19, 2017
Messages
134
Trophies
0
Website
matthewrease.net
XP
242
Country
United States
Creates an FS_Path instance. Basically the same thing you were trying to do with "testDir" except cleaner.
well thanks for that part, but the folder still doesn't get deleted :P
maybe since I'm specifying the ARCHIVE_SDMC, I don't need to do sdmc:/ like you would with a file stream in c/c++ normally. maybe I just do 3ds/ROT_Data
I'll try that and tell you how it goes.

EDIT: nope it didn't work like that either...
 
Last edited by Magicrafter13,

Joel16

Ils ne passeront pas
Member
Joined
May 8, 2011
Messages
933
Trophies
2
Age
27
Location
Doesn't concern you.
XP
5,258
Country
United States
well thanks for that part, but the folder still doesn't get deleted :P
maybe since I'm specifying the ARCHIVE_SDMC, I don't need to do sdmc:/ like you would with a file stream in c/c++ normally. maybe I just do 3ds/ROT_Data
I'll try that and tell you how it goes.

Oh right forgot about that, yeah
Code:
FSUSER_DeleteDirectoryRecursively(ARCHIVE_SDMC, fsMakePath(PATH_ASCII, "/3ds/ROT_Data"));

Edit: what exactly is ARCHIVE_SDMC? FSUSER_DeleteDirectoryRecursively is looking for FS_Archive, not FS_ArchiveID.

Should work I believe.
 
Last edited by Joel16,

Magicrafter13

Well-Known Member
Member
Joined
Feb 19, 2017
Messages
134
Trophies
0
Website
matthewrease.net
XP
242
Country
United States
Oh right forgot about that, yeah
Code:
FSUSER_DeleteDirectoryRecursively(ARCHIVE_SDMC, fsMakePath(PATH_ASCII, "/3ds/ROT_Data"));

Edit: what exactly is ARCHIVE_SDMC? FSUSER_DeleteDirectoryRecursively is looking for FS_Archive, not FS_ArchiveID.

Should work I believe.
Well like I said earlier... I have no idea how libctru's filesystem stuff works.

--------------------- MERGED ---------------------------

Are you using FSUSER_OpenArchive? before calling FSUSER_DeleteDirectoryRecursively?
Example?
 

Joel16

Ils ne passeront pas
Member
Joined
May 8, 2011
Messages
933
Trophies
2
Age
27
Location
Doesn't concern you.
XP
5,258
Country
United States
Well like I said earlier... I have no idea how libctru's filesystem stuff works.

Well first you need to have FS initialized somewhere.

Code:
fsInit();
sdmcInit();

Then you need to open the SDMC archive since you're conducting file operations on the SD, you can close it once you're done handling all your file stuff.

Code:
FS_Archive sdmcArchive; // Global variable, you'll need this for conducting other file operations.

void openArchive()
{
    FSUSER_OpenArchive(&sdmcArchive, ARCHIVE_SDMC, fsMakePath(PATH_EMPTY, ""));
}

Once you've done that, you can now use the delete function:
Code:
FSUSER_DeleteDirectoryRecursively(sdmcArchive, fsMakePath(PATH_ASCII, "/3ds/ROT_Data"))

Once you're done deleting you can close the archive.
Code:
void closeArchive(void)
{
    FSUSER_CloseArchive(sdmcArchive);
}
 
  • Like
Reactions: Magicrafter13

Magicrafter13

Well-Known Member
Member
Joined
Feb 19, 2017
Messages
134
Trophies
0
Website
matthewrease.net
XP
242
Country
United States
Well first you need to have FS initialized somewhere.

Code:
fsInit();
sdmcInit();

Then you need to open the SDMC archive since you're conducting file operations on the SD, you can close it once you're done handling all your file stuff.

Code:
FS_Archive sdmcArchive; // Global variable, you'll need this for conducting other file operations.

void openArchive()
{
    FSUSER_OpenArchive(&sdmcArchive, ARCHIVE_SDMC, fsMakePath(PATH_EMPTY, ""));
}

Once you've done that, you can now use the delete function:
Code:
FSUSER_DeleteDirectoryRecursively(sdmcArchive, fsMakePath(PATH_ASCII, "/3ds/ROT_Data"))

Once you're done deleting you can close the archive.
Code:
void closeArchive(void)
{
    FSUSER_CloseArchive(sdmcArchive);
}

Finally worked, thank you!

Honestly just this post alone from you could be a tutorial. It's a shame there aren't any good tutorials for 3ds homebrew with libctru (other than the basic ones).
I guess most homebrew developers are already really good at coding, and understand a lot of the terminology. I won't lie, I didn't understand structs in c++ until a few hours ago.

In case you're wondering, here's what I missed:
the Init() functions, the open and close archive, and I had incorrect syntax in openarchive.

[Just saying, this: https://github.com/xem/3DShomebrew/wiki guide could use more work, and it's open to contributors. Maybe you could do some stuff about filesystem, and I mean more than just how to delete something, I mean a basic or advanced guide to how to use the filesystem functions. But obviously, it's up to you, just an idea.]
 
  • Like
Reactions: Joel16

Joel16

Ils ne passeront pas
Member
Joined
May 8, 2011
Messages
933
Trophies
2
Age
27
Location
Doesn't concern you.
XP
5,258
Country
United States
Finally worked, thank you!

Honestly just this post alone from you could be a tutorial. It's a shame there aren't any good tutorials for 3ds homebrew with libctru (other than the basic ones).
I guess most homebrew developers are already really good at coding, and understand a lot of the terminology. I won't lie, I didn't understand structs in c++ until a few hours ago.

In case you're wondering, here's what I missed:
the Init() functions, the open and close archive, and I had incorrect syntax in openarchive.

[Just saying, this: https://github.com/xem/3DShomebrew/wiki guide could use more work, and it's open to contributors. Maybe you could do some stuff about filesystem, and I mean more than just how to delete something, I mean a basic or advanced guide to how to use the filesystem functions. But obviously, it's up to you, just an idea.]

You'll find most up to date samples here: https://github.com/devkitPro/3ds-examples

But yes you're right most things are basic, and that repository doesn't even have an example for using FS_User functions. I had to read and break things/re-test over and over to get the FS_User functions working the first time. There's not a lot of information on how to use them apart from people who've used it in their open source projects on GitHub, and that's generally not a good starting point for new comers unless you know your way with 3DS homebrew development.
 

Magicrafter13

Well-Known Member
Member
Joined
Feb 19, 2017
Messages
134
Trophies
0
Website
matthewrease.net
XP
242
Country
United States
You'll find most up to date samples here: https://github.com/devkitPro/3ds-examples

But yes you're right most things are basic, and that repository doesn't even have an example for using FS_User functions. I had to read and break things/re-test over and over to get the FS_User functions working the first time. There's not a lot of information on how to use them apart from people who've used it in their open source projects on GitHub, and that's generally not a good starting point for new comers unless you know your way with 3DS homebrew development.
Yeah I've tried using other GitHub projects as examples for some things, but it's clear to me their level of expertise is far above mine, because when I look at their code I have no idea what's going on half the time.
 

Magicrafter13

Well-Known Member
Member
Joined
Feb 19, 2017
Messages
134
Trophies
0
Website
matthewrease.net
XP
242
Country
United States
where would I even begin to learn how to make a homebrew application on 3ds?
Well for starting, literally just google it. There are a few short tutorials on how to get you started.

--------------------- MERGED ---------------------------

@Joel16 You wouldn't happen to know anything about graphics would you?
 

Joel16

Ils ne passeront pas
Member
Joined
May 8, 2011
Messages
933
Trophies
2
Age
27
Location
Doesn't concern you.
XP
5,258
Country
United States
Well for starting, literally just google it. There are a few short tutorials on how to get you started.

--------------------- MERGED ---------------------------

@Joel16 You wouldn't happen to know anything about graphics would you?

You can how a look at this: https://github.com/devkitPro/3ds-examples/tree/master/graphics
or if you want to use a third party library you can have a look at SF2D/SFIL samples. (Be warned these libraries are deprecated but they're easier to understand when compared to the cancer that is citro3D).
 

Magicrafter13

Well-Known Member
Member
Joined
Feb 19, 2017
Messages
134
Trophies
0
Website
matthewrease.net
XP
242
Country
United States
You can how a look at this: https://github.com/devkitPro/3ds-examples/tree/master/graphics
or if you want to use a third party library you can have a look at SF2D/SFIL samples. (Be warned these libraries are deprecated but they're easier to understand when compared to the cancer that is citro3D).
Fair enough, I went to try sf2d once but since it said try citro3d I did... after reading some citro docs I was like f*** it.
 

Magicrafter13

Well-Known Member
Member
Joined
Feb 19, 2017
Messages
134
Trophies
0
Website
matthewrease.net
XP
242
Country
United States

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
  • ZeroT21 @ ZeroT21:
    it wasn't a question, it was fact
  • BigOnYa @ BigOnYa:
    He said he had 3 different doctors apt this week, so he prob there. Something about gerbal extraction, I don't know.
    +1
  • ZeroT21 @ ZeroT21:
    bored, guess i'll spread more democracy
  • LeoTCK @ LeoTCK:
    @K3Nv2 one more time you say such bs to @BakerMan and I'll smack you across the whole planet
  • K3Nv2 @ K3Nv2:
    Make sure you smack my booty daddy
    +1
  • LeoTCK @ LeoTCK:
    telling him that my partner is luke...does he look like someone with such big ne
    eds?
  • LeoTCK @ LeoTCK:
    do you really think I could stand living with someone like luke?
  • LeoTCK @ LeoTCK:
    I suppose luke has "special needs" but he's not my partner, did you just say that to piss me off again?
  • LeoTCK @ LeoTCK:
    besides I had bigger worries today
  • LeoTCK @ LeoTCK:
    but what do you know about that, you won't believe me anyways
  • K3Nv2 @ K3Nv2:
    @BigOnYa can answer that
  • BigOnYa @ BigOnYa:
    BigOnYa already left the chat
  • K3Nv2 @ K3Nv2:
    Biginya
  • BigOnYa @ BigOnYa:
    Auto correct got me, I'm on my tablet, i need to turn that shit off
  • K3Nv2 @ K3Nv2:
    With other tabs open you perv
  • BigOnYa @ BigOnYa:
    I'm actually in my shed, bout to cut 2-3 acres of grass, my back yard.
  • K3Nv2 @ K3Nv2:
    I use to have a guy for that thanks richard
  • BigOnYa @ BigOnYa:
    I use my tablet to stream to a bluetooth speaker when in shed. iHeartRadio, FlyNation
  • K3Nv2 @ K3Nv2:
    While the victims are being buried
  • K3Nv2 @ K3Nv2:
    Grave shovel
  • BigOnYa @ BigOnYa:
    Nuh those goto the edge of the property (maybe just on the other side of)
  • K3Nv2 @ K3Nv2:
    On the neighbors side
    +1
  • BigOnYa @ BigOnYa:
    Yup, by the weird smelly green bushy looking plants.
    K3Nv2 @ K3Nv2: https://www.the-sun.com/news/10907833/self-checkout-complaints-new-target-dollar-general-policies...