View Full Version : Find Certain File Extensions

04-12-2003, 12:10 PM
This is more a C++ question, but ive had such good luck on these boards i figured i would post it here...
Im working on a program, and i need it to search through a folder and find all the files that end with a certain extension (.ase)... how do i get it to just go file by file and see if they end in .ase?

04-12-2003, 12:35 PM
another thing i just realized... i have a class called "model" to hold all the info about a model that is imported... the problem is, in the .ase file, there is a name for the model.. i also need to bring that name in, and then assign it as
model (whatever the name is);
how would i do this? this is how i have it, it tries to re-define "modelname"

char modelname[255];
when i try fscanf(*FILE*, "%s", &modelname);
model modelname;

any ideas?
thanks again!

04-12-2003, 01:05 PM
Those question has nothing with OpenGL!
But I'll help You.
To Find the file files *.ase You should do this:

#include <dir.h>

ffblk f;
done = findfirst("*.ase", &f, NULL);
while (!done)
// f.ff_name holds the file name
done = findnext(&f);

The second. I don't know ASE structure. You should check this for example in www.gametutorials.com (http://www.gametutorials.com)
To read the model name You have to know the adress of the chunk which keeps this and read this by function fread.


04-14-2003, 05:34 AM
dir /s *.ase