Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: quickest way to find number of files in a directory?

by johngg (Abbot)
on Mar 27, 2007 at 15:05 UTC ( #606767=note: print w/replies, xml ) Need Help??


in reply to quickest way to find number of files in a directory?

You could try this. It excludes the '.' and '..' links

$ perl -le ' opendir D, q{dirname} or die $!; print scalar grep { ! m{^\.\.?$} } readdir D;' 123 $

Cheers,

JohnGG

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://606767]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (4)
As of 2016-12-11 00:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (168 votes). Check out past polls.