Iterate through a directory and read all the files
by gamer · in Torque Game Engine · 08/16/2006 (7:09 pm) · 0 replies
I am looking for an alternative way of walking through a directory and read all the files, is there any way?
The reason is that my program allows user to create and delete files, and findFirstFile/findNextFile always caches the result. To reload the cache I must call setModPaths(getModPaths()). The modPaths is usually "creator;common;myGame", and it take a long time for setModPaths(getModPaths()) to finish.
I just need a simple way to iterate through all files in a directory given the directory name, so findFirstFile/findNextFile given patterns on all the modPaths seem to be an overkill.
I hope someone can help me!
thanks
The reason is that my program allows user to create and delete files, and findFirstFile/findNextFile always caches the result. To reload the cache I must call setModPaths(getModPaths()). The modPaths is usually "creator;common;myGame", and it take a long time for setModPaths(getModPaths()) to finish.
I just need a simple way to iterate through all files in a directory given the directory name, so findFirstFile/findNextFile given patterns on all the modPaths seem to be an overkill.
I hope someone can help me!
thanks
About the author