You could use the Perl "opendir" and "readdir" functions or the "glob"
function but either way you want to test each returned value to see if it is
a file or directory and add each file to a running count.

Hope this helps.

Kind regards,
Trevor J. Joerges
--------------------------------------------
$_=q;rrUSFWPSZK.ZKPFSHFT,rkvtuZbopuifsZQZibdl
rrqpxfsfeZcyZQ,,riuuq://xxx.%.dpn,ru~@%.dpn ,rrr8-)
;;s;\~;kpfshft;g;s;\%;tfoenjnf;g;y;B-x;A-w;;
s;P;perl;g;s;,;\n;g;s;Y; ;g;s;q;\t;g;print;
--------------------------------------------


----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, April 19, 2002 8:19 AM
Subject: [Perl-unix-users] Count Number of files


:
:
: Whats the easiest way to get a count of the number of files in a directory
: using pure perl ?
:
: Any help appreciated.
:
: Thanks
: Kwabena
:
:
:
:
: _____________________________________________________
:
: This transmission has been issued by a member of the HSBC Group
: "HSBC" for the information of the addressee only and should not be
: reproduced and / or distributed to any other person. Each page attached
: hereto must be read in conjunction with any disclaimer which forms part
: of it. Unless otherwise stated, this transmission is neither an offer nor
the
: solicitation of an offer to sell or purchase any investment. Its contents
are
: based on information obtained from sources believed to be reliable but
: HSBC makes no representation and accepts no responsibility or liability as
: to its completeness or accuracy.
:
: _______________________________________________
: Perl-Unix-Users mailing list
: [EMAIL PROTECTED]
: To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
:


_______________________________________________
Perl-Unix-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to