Code for loading an array with a list of filenames from a directory

Hello,

I’m sorry for this basic 101 question, but I’m not actually doing the codeing. My nephew is. I think he’s hard coding filenames into an array and I don’t understand why you can programatically load up an array at initilization time. Basically we want to take all of the file names in a directory and load them into an array so we can pick and choose which files to display later on.

Is there a simple way to do this?

thanks for your time,

Arthur [import]uid: 125260 topic_id: 22436 reply_id: 322436[/import]

Corona SDK does not provide a directory list function to get a list of files in the folder. [import]uid: 19626 topic_id: 22436 reply_id: 89466[/import]

********** CRAP ***** TRYING TO MOVE FOLDER - DELETED THE FORUM BY ACCIDENT
[import]uid: 24 topic_id: 22436 reply_id: 89491[/import]

How convenient @Carlos, have another go :slight_smile: [import]uid: 3826 topic_id: 22436 reply_id: 89535[/import]

I figured out a MORE programmatic way to do this although it is not the ideal.

Copy the list of files in a directory to a file named filelistnames
On program load load that file into an array.
Your done.

Anytime you need to add new files to that directory add the file names to the filenames file and they will be picked up at program load.

This is less manual then entering file names into your source code, but less automatic than a function call.
Arthur [import]uid: 125260 topic_id: 22436 reply_id: 89625[/import]