Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Read all files and folder in your media folder using Folder() commands

Author
Message
Golelorn
7
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 6th Apr 2019 16:57
After a couple days trying to work this out, I was finally able to figure out all the nuances of the Folder commands.


I have not seen anything on the site except for MadLibs plugin, and I wasn't sure it could do what I wanted. Plus, I didn't want to take time to learn how to use plug-ins.

So far, this works for me. Not saying its bug-free.

This example does not pick up files directly in the media folder, only subfolders. And my example only picks up PNGs and JPGs. But, easily adjustable.

Golelorn
7
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 7th Apr 2019 14:29
I just ran into another problem with the Folder commands being opposite of the Raw commands.

Raw returns backslash("\") and Folder returns forward slash "/". This is significant because if you try to search these against each other it will fail. Would love to see the Folder commands be more consistent.
PSY
Developer
7
Years of Service
User Offline
Joined: 3rd Jul 2016
Location: Laniakea Supercluster
Posted: 7th Apr 2019 19:50
Nice work.
Haven't done much with file commands in AppGameKit, but it's on my list. Thanks for the heads-up with the slashes

Have you tried a recursive approach? Scanning through subdirectories is easier and cleaner that way



PSY LABS Games
Coders don't die, they just gosub without return
Golelorn
7
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 7th Apr 2019 21:09
I have no idea how to do that, and getting a grasp of the Folder commands was a challenge itself. Maybe in a few years I will want to venture back into that minefield.
PSY
Developer
7
Years of Service
User Offline
Joined: 3rd Jul 2016
Location: Laniakea Supercluster
Posted: 7th Apr 2019 23:13 Edited at: 7th Apr 2019 23:20
For example, this should be able to recursively scan through your Documents folder and all sub folders.
It's pretty basic, though. Only counts all files and folders while crawling through the entire tree structure.
Maybe you can use it some time.



PSY LABS Games
Coders don't die, they just gosub without return
Golelorn
7
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 8th Apr 2019 01:49
Very nice, thanks!

Login to post a reply

Server time is: 2024-03-28 14:07:23
Your offset time is: 2024-03-28 14:07:23