For Programmers: Free Programming Magazines  


Home > Archive > PERL Beginners > October 2004 > Counting files in folder









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Counting files in folder
dsehmby

2004-10-27, 9:29 am

Hi,

Could anyone provide me a sample Perl code on how to count the number of files in a folder?

Any help is much appreciated.

Thanks
dsehmby

2004-10-27, 9:53 am

quote:
Originally posted by dsehmby
Hi,

Could anyone provide me a sample Perl code on how to count the number of files in a folder?

Any help is much appreciated.

Thanks

dsehmby

2004-10-27, 9:54 am

I have found the code...cheers

opendir(DIR, "directory path in here");
@files1 = readdir(DIR);
$arrlength1 = @files1-2;
print "$arrlength1";
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com