How to count the size of files in a directory
From: Danield (sun_x86_at_telus.net)
Date: 12/28/03
- Previous message: Tim Johnson: "RE: Scripting a CLI command on Windows 2000"
- Next in thread: Tom Kinzer: "RE: How to count the size of files in a directory"
- Reply: Tom Kinzer: "RE: How to count the size of files in a directory"
- Reply: Rob Dixon: "Re: How to count the size of files in a directory"
- Reply: Shawn McKinley: "RE: How to count the size of files in a directory"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
To: perl_beginer <beginners@perl.org> Date: Sat, 27 Dec 2003 23:14:32 -0700
Hello all,
I do have a beautiful script, that counts a size of specified files
("ABAA.txt", "ABAC.txt") in a directory test. I have got this script
from discussion board.
Here is the script:
my $dir='c:\\test';
my @files2check = ("ABAA.txt", "ABAC.txt");
my $totalSize= 0;
foreach (@files2check) {
$totalSize += (-s "$dir\\$_");
}
print $totalSize;
I would like to modify it that it will count the size of all files in the directory, EXCEPT those in list or so it will count the size of files that match first 2 characters "AB" (sort of AB*)
Can anybody advice?
Thank you for your time.
danield
- Previous message: Tim Johnson: "RE: Scripting a CLI command on Windows 2000"
- Next in thread: Tom Kinzer: "RE: How to count the size of files in a directory"
- Reply: Tom Kinzer: "RE: How to count the size of files in a directory"
- Reply: Rob Dixon: "Re: How to count the size of files in a directory"
- Reply: Shawn McKinley: "RE: How to count the size of files in a directory"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|