Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

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

by trizen (Hermit)
on Dec 11, 2011 at 02:50 UTC ( [id://942896]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl
    
    use strict;
    ...
        ($f, $d) = (0, 0);
        print "$arg\nFiles\t: $$_[0]\nDirs\t: $$_[1]\n" for count_files(\@
    +dir);
    }
    
  2. or download this
    $ time perl test.pl /tmp/ /usr/bin/ /media/
    /tmp/
    Files    : 844
    ...
    real    0m0.111s
    user    0m0.030s
    sys    0m0.070s
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (1)
As of 2024-04-25 00:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found