Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
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


Comment on Re: quickest way to find number of files in a directory?
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://606767]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (14)
As of 2014-12-19 16:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (87 votes), past polls