giovedì 27 maggio 2010

Script PERL : Totals File in a Directory

This is a simple script to show total number of Files in a directory.

Script accepts in input one argument : Directory.


$totfile = 0;
opendir(my $dh, $ARGV[0]) || die;
while(readdir $dh) {
print "$some_dir/$_\n";
$totfile++;
}
closedir $dh;

printf(" Tot Files : $totfile \n");

Stay Connected.

Nessun commento:

Posta un commento

Check first quarter 2024

 Hi all Today, 1st May I'll check my 2024 goals. This is the first time I check it. For me it's a good way to reach more objective p...