Starshyne Emir wrote: "It may work better adding every retrieved music file to a list - with ARRAY INSERT AT BOTTOM or whatever - at least from my point of view. "
I don't like using that command. Also you might have performance problems using it with a large array. Commands like that you never know what they are really doing and they might run through the entire list every time. Small arrays you don't notice but problems can creep up when you scale things up. You decide.
Starshyne Emir wrote: "I have 27 thousand music files and I don't know if expanding the array every time I need more space is the best alternative."
The array expands at bursts of 100, not every time. However I would suggest changing this to 1000 increments instead for your case.
You're going to find that the most significant time consuming process is actually searching the folders and files. The File I/O is many orders of magnitude slower than any array operations you might be performing.
Starshyne Emir wrote: "I will not just copy and paste yor code. In fact, I'll use it as inspiration, since I understood how you made the recrsion and, man, your programming logic is awesome!"
Use it if you like. It is kind of a waste if you do not.