All,
When I try to use $pathname to get the dir name in the format section, I don't see any
value. Also where do I add the follow_skip section in the File::Find program to skip
duplicate file names.
#!/usr/bin/perl
use File::Find;
format OUTPUT_TOP =
NAME FILESIZE PATH
---------------- -------- -----
.
format OUTPUT =
@<<<<<<<<<<<<<<<<<<<<<< @|||||
$_ $filesize $pathname
.
print "Enter the directory you want to search: ";
open (INPUT, $dir);
chomp($dir = <>);
open(OUTPUT, ">reports.txt");
find(\&wanted, $dir);
while(<IN>) {
sub wanted() {
return if $_ eq "." or $_ eq "..";
return if -d $_;
return unless -l $_;
$filesize = $_;
chomp $filesize;
$minsize = 1000000;
$filesize = -s;
if ($filesize > $minsize ) {
$pathname = File::Find::dir;
# print OUTPUT "File_Name: $_\t"."Byte_Size: $filesize\n"."\tDir_Path:
$File::Find::dir\n";
$totalsize += $filesize;
write OUTPUT;
}
} ;
close IN;
close OUTPUT;
};
print OUTPUT "\n\n\n\nTotal size of all files in this report is $totalsize bytes\n";
__________________________________________________________________
The NEW Netscape 7.0 browser is now available. Upgrade now!
http://channels.netscape.com/ns/browsers/download.jsp
Get your own FREE, personal Netscape Mail account today at http://webmail.netscape.com/
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]