how to get the list of files with a certain extension in a folder ?
Hi All,
Is there any C/C++ API in Linux that I can use to get the names of the files in a folder with a certain extension ?
I came across readdir() and scandir() functions.
readdir() gives the list of all files - it does not seem to be providing any filtering option.
scandir() provides some filtering options, but I could not understand if it is capable of giving me the names of the files with a certain extension.
I just want to avoid extra string processing in my application, but have C/C++ API perform that instead.
Any ideas ?
Thanks.
|