Looping through files in a folder
by Vern Jensen · in Torque Game Builder · 09/19/2007 (12:15 pm) · 2 replies
Let's say I have a path, such as:
/game/MyCustomStuff/paths/
and I want to loop through everything in that "paths" folder and get a path to each file in it, so I can open each file and load its contents into memory. How can this be accomplished?
I tried using some stuff in FileSystem, but this seems to be for *all* files in the entire game hierarchy. I want to limit my searches to a specific directory. I tried using setCurrentDirectory(), but it seems this function doesn't exist. Or I don't know how to call it properly. Ideas?
/game/MyCustomStuff/paths/
and I want to loop through everything in that "paths" folder and get a path to each file in it, so I can open each file and load its contents into memory. How can this be accomplished?
I tried using some stuff in FileSystem, but this seems to be for *all* files in the entire game hierarchy. I want to limit my searches to a specific directory. I tried using setCurrentDirectory(), but it seems this function doesn't exist. Or I don't know how to call it properly. Ideas?
Torque Owner Vern Jensen
And that works like a charm.