HISE Logo Forum
    • Categories
    • Register
    • Login

    Get Subfolder List?

    Scheduled Pinned Locked Moved General Questions
    5 Posts 2 Posters 187 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • ?
      A Former User
      last edited by A Former User

      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...

      ulrikU 1 Reply Last reply Reply Quote 0
      • ulrikU
        ulrik @A Former User
        last edited by

        @iamlamprey Have you tried to change the last argument to true?

        local expansion_list = FileSystem.findFiles(expansions_root, "", true);
        

        Hise Develop branch
        MacOs 15.3.1, Xcode 16.2
        http://musikboden.se

        ? 1 Reply Last reply Reply Quote 0
        • ?
          A Former User @ulrik
          last edited by

          @ulrik No luck unfortunately :) I'm sure it's something simple like that though, my brain is just fried atm

          ulrikU 1 Reply Last reply Reply Quote 0
          • ulrikU
            ulrik @A Former User
            last edited by

            @iamlamprey I think you need the asterisk as well

            local expansion_list = FileSystem.findFiles(expansions_root, "*", true);
            

            Hise Develop branch
            MacOs 15.3.1, Xcode 16.2
            http://musikboden.se

            ? 1 Reply Last reply Reply Quote 1
            • ?
              A Former User @ulrik
              last edited by

              @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!

              1 Reply Last reply Reply Quote 0
              • First post
                Last post

              27

              Online

              1.7k

              Users

              11.8k

              Topics

              102.8k

              Posts