Get Subfolder List?
-
T-shirt question incoming.
I'm writing a "restore from backup" method for expansion.hxi's and I need to get a list of expansion subfolders, including ones that don't have .hxi's in them (so they won't show up in the expansionHandler list).
Is there a way to get a list of all subfolders using the FileSystem? I've tried this but the wildcard didn't find anything:
inline function restoreAllExpansionsFromBackup() { local expansions_root = FileSystem.getFolder(FileSystem.Expansions); local expansion_list = FileSystem.findFiles(expansions_root, "", false); //returns nothing, ideally would return a list of subfolders local test = expansions_root.getChildFile("Achromic"); //This works, but I need it to be name-agnostic }
Perhaps a .getChildFiles() method?
Edit: apologies for no camelcase, I was studying python earlier this year...
-
@iamlamprey Have you tried to change the last argument to true?
local expansion_list = FileSystem.findFiles(expansions_root, "", true);
-
@ulrik No luck unfortunately :) I'm sure it's something simple like that though, my brain is just fried atm
-
@iamlamprey I think you need the asterisk as well
local expansion_list = FileSystem.findFiles(expansions_root, "*", true);
-
@ulrik Yes, legend! The sneaky asterisk was the missing piece. In my case I don't need recursive though since I'm just looking for the subfolders, not their contents.
Cheers!