File searching function
Hi, I am working on a program (DOS). I need a function that finds all files with a certain extension (ie *.txt) in a folder. It should return an array of pointers to these files, or something similar.
Does this function exist (I took a quick look in fstream.h, didn't find it) or do I have to make my own? If so, can you give me a hint how I would start?
some systems implement a findfirst function, look for it as _findfirst maybe the compiler should explain how to use it? also i've seen somewhere a function called listdir that had syntax something like this
name was the actuall name (NULL == *)
listdir(char * name, char * type, char * dir, bool branch);
type was the extension (NULL == *)
dir was the directory
branch was if you wanted to recurse subdirectories.
But listdir may have been included in some library i had, or worst case scenario it could have been a different language (pascal maybe?)
I found the Findfirst and Findnext functions. I'll check them out tomorrow. Thanks a lot.