List of files in directory

Home Forums General Programming List of files in directory

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #6464
    artofnois
    Participant
      • Topics: 26
      • Replies: 40
      • Total: 66

      I want to get a list with all the files in a direcory (*.syx) to processes from  panel

      So copied from the forum somethin like

      function getFiles( carpeta )
      t = {}
      f = File( carpeta )
      f:findChildFiles (t, File.findDirectories, false, “*.syx”)
      for i,v in ipairs(t)
      do
      —        console(v:getFullPathName())
      —        getPathLine = v:getFullPathName() — get value but is always userdata
      —        console(getPathLine)
      —        console(type(getPathLine))
      end
      end

       

      So I get in console a list of the files from de “carpeta” directory.

      But alltime crashes

      Any help?

       

       

      #6474
      artofnois
      Participant
        • Topics: 26
        • Replies: 40
        • Total: 66

        Please Atom, can you help me?

         

        #6475
        atom
        Keymaster
          • Topics: 159
          • Replies: 2945
          • Total: 3104
          • ★★★★★
          t = {}
          f = File ("c:\\devel")
          f:findChildFiles (t, File.findDirectories, true, "*")
          for i,v in ipairs(t) do
          	console (v:getFullPathName())
          end
          

          This code will work in the latest nightly your code has some special character

          ERROR: [string "t = {}..."]:3: unexpected symbol near 'â'
          
          don't know where is it what is it, but you need to look for that too.
        Viewing 3 posts - 1 through 3 (of 3 total)
        • The forum ‘Programming’ is closed to new topics and replies.
        There is currently 0 users and 65 guests online
        No users are currently active
        Forum Statistics
        Threads: 2,495, Posts: 17,374, Members: 77,605
        Most users ever online was 12 on January 22, 2019 3:47 pm
        Ctrlr