Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: count files in a directory

by jwkrahn (Monsignor)
on Oct 10, 2011 at 11:59 UTC ( #930598=note: print w/replies, xml ) Need Help??


in reply to count files in a directory

count files in a directory

This will give you the count of "files" in a directory:

my $dirname = "/home/oracle/test/Oracle/oradata"; opendir my $DIR, $dirname or die "Error in opening dir '$dirname' beca +use: $!"; my $count = grep -f "$dirname/$_", readdir $DIR; closedir $DIR;

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://930598]
help
Chatterbox?
[Discipulus]: uch; everytime i want to read some source code i finally choke against an XS..

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (8)
As of 2016-12-05 10:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (79 votes). Check out past polls.