In C, can I li开发者_如何学Pythonst all files with certain extension inside a dir?
Any api available?
"ls" would be the last thing I want to do.
Thanks in advance.
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.
精彩评论