Is there any way in C to remove (using remove()) multiple files using a * (wildcards)? I have a set of files that all start with Index. For example: Index1.txt Index-39.txt etc. They all start with Index but I don't know what text follows. There are also other files in the same directory so deleting all files won't work.
I know you can read the directory, iterate each file name, read the the first 5 chars, compare and if it fits then delete, but, is there an easier way (this is what I currently do by the way)?
code is appreciated.
Thanks!
EDIT: I forgot to mention that this is standard C, since the code runs on Linux and Windows