
Bode
Novice
Feb 18, 2003, 7:35 AM
Post #4 of 13
(5432 views)
|
Cheers for the pointer . This is the script that I am using is below. its finding the files that I want to find and is telling me the dir that they reside in, which is cool. The problem is the DIR structure it goes - \\stu-storage2\ then DIR 0 (under each of these is the actual users area i.e. all user whos id begins with 0, e.g tr011, xn023) DIR 1 DIR 2 DIR ..n Because the script transverses the whole DIR I am having difficulties with getting a handle on each actual user area (dir) so I can build up specific stats i.e the complete size of all the mp3 files on that particular user area. Any ideas ? use File::Find; my $ByteCount=0; find(\&forbiddenSearch, "\\storage-stu2\user-area\"); # Subroutine that determines whether we matched the file extensions. sub forbiddenSearch { if ((/\.MP3$/) || (/\.mp3$/) || (/\.mpg$/) || (/^~/) || (/\.wav$/) ){ print "$File::Find::name\n"; my ($dev, $ino, $mode, $nlink, $uid, $gid, $rdev, $size, $therest) = stat($_) or die "Unable to stat $_\n"; print "File Size is $size\n\n"; #$ByteCount += $size; } }
|