Implementing a file counter (like "ls | wc")
We implemented a program that use "opendir()", "readdir()", and "closedir()" to scan a directory and count the files contained into it.
But, it program have taking more time than "ls | wc" to count files.
Does have any other way to count files faster?
PS: Our program needs sometime to filter files by extension (like: *.c, *.cpp, and so on. Thus we use strcmp() to compare last letters of both strings).
Luciano