Reputation: 9733
In C, can I list all files with certain extension inside a dir?
Any api available?
"ls" would be the last thing I want to do.
Thanks in advance.
Upvotes: 2
Views: 141
Reputation: 51157
On UNIX, you're looking for opendir
and readdir
(and maybe fnmatch
) or alternatively glob
(which puts those three together for you). These are not part of C, but rather POSIX.
Upvotes: 7