in reply to Re^2: fast count files
in thread fast count files
If you literally just want to count the files on the entire disk, this is by far the fastest simple method I know of.
It counts the 1.2 million files on my cold-cache, 640GB (400GB used) drive in a little under 7 minutes:
$t=time; $n = `attrib /s c:\\* | wc -l`; printf "$n : %.f\n", time()-$t;; 1233597 : 394
Try it and see how you fare. I vaguely remember finding a faster method years ago, and I'll try to remember enough to look it up.
Note: Don't do my @files = `attrib /s c:\\*`; my $n = scalar @files; All the memory allocation slows things down horribly.
With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: fast count files
by cdarke (Prior) on Jan 06, 2012 at 11:10 UTC | |
Re^4: fast count files
by gautamparimoo (Beadle) on Jan 06, 2012 at 11:23 UTC | |
by BrowserUk (Pope) on Jan 06, 2012 at 12:19 UTC | |
by gautamparimoo (Beadle) on Jan 06, 2012 at 12:30 UTC | |
by Sinistral (Monsignor) on Jan 06, 2012 at 13:44 UTC | |
by marto (Cardinal) on Jan 06, 2012 at 11:36 UTC |
In Section
Seekers of Perl Wisdom