linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: Implementing a file counter (like "ls | wc")
@ 2004-04-07 14:35 Alphex K.
  2004-04-07 14:47 ` Luciano Moreira - igLnx
  0 siblings, 1 reply; 5+ messages in thread
From: Alphex K. @ 2004-04-07 14:35 UTC (permalink / raw)
  To: lucianolnx; +Cc: linux-c-programming

On Wed, 07 Apr 2004 11:27:02 -0300
Luciano Moreira - igLnx <lucianolnx@ig.com.br> wrote:

> We implemented a program that use "opendir()", "readdir()", and 
> "closedir()" to scan a directory and count the files contained into it.
How U use this functions?
But I'm think that it's not good method
> 
> 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).
If U want a more speed don't use strcmp or strncmp functions.
> 
> Luciano
> 
U use a C++ ? or C ?
> -
> To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


---===---
Alphex Kaanoken
Senior developer of Crew IT research labs
web: http://crew.org.ru
mailto:Alphex@Crew.Org.RU


---===---
Alphex Kaanoken
Senior developer of Crew IT research labs
web: http://crew.org.ru
mailto:Alphex@Crew.Org.RU

^ permalink raw reply	[flat|nested] 5+ messages in thread
* Implementing a file counter (like "ls | wc")
@ 2004-04-07 14:27 Luciano Moreira - igLnx
  0 siblings, 0 replies; 5+ messages in thread
From: Luciano Moreira - igLnx @ 2004-04-07 14:27 UTC (permalink / raw)
  To: linux-c-programming

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-04-13 12:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-04-07 14:35 Implementing a file counter (like "ls | wc") Alphex K.
2004-04-07 14:47 ` Luciano Moreira - igLnx
2004-04-07 15:34   ` Holger Kiehl
2004-04-13 12:52   ` Steven Smith
  -- strict thread matches above, loose matches on Subject: below --
2004-04-07 14:27 Luciano Moreira - igLnx

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).