Getting list of files

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
richardmac
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 211
Joined: Sun Oct 24, 2010 12:13 am

Getting list of files

Post by richardmac » Sun Jan 15, 2012 3:26 pm

I have an assets folder in the same directory as my stack, and I always include it in the "Copy Files" area of the standalone settings. So I can set the filename of a graphic to, say, "./assets/mybackground.png" and it will work fine.

But how do I get a listing of the file names inside of the assets folder? Normally you can set the directory to a path and then get "the files," but I can't seem to make that work on the iOS. If it is not possible to get a list of files, I can work around it. I'm just trying to determine if it's possible or not.

Klaus
Posts: 14182
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Getting list of files

Post by Klaus » Sun Jan 15, 2012 4:35 pm

Hi richard,

so this does not work for you?
...
put specialfolderpath("engine") & "/assets/" into tFolder

## old habit to save and restore the default folder, but won't hurt ;-)
put the directory into tOldDir
set the directory to tFolder
put the files into fld "the image files"
set the directory to tOldDir
...

Best

Klaus

richardmac
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 211
Joined: Sun Oct 24, 2010 12:13 am

Re: Getting list of files

Post by richardmac » Sun Jan 15, 2012 7:02 pm

AH! Yeah, I forgot the specialfolderpath. Sometimes it's the most obvious things that get overlooked. Once again, I thank you, Klaus. I REALLY appreciate it.

FireWorx
Posts: 362
Joined: Wed Sep 07, 2011 9:39 pm

Re: Getting list of files

Post by FireWorx » Sun Jan 15, 2012 7:18 pm

Hi Richard,
What I found to be helpful is place a transparent button in the corner of one of my backgrounds that requires a password. When you type in the password a group shows itself that allows you to view all the folders and files in the engine folder, documents folder, library folder, etc. You just type in the name of the IOS filer and get to view everything that is inside. See the attached stack. Also included a button that moves all folders over from the engine folder to documents and a button that clears out the IOS documents folder.

Hope this helps some one.

Dave
Attachments
View Files.zip
(191.77 KiB) Downloaded 304 times

Post Reply