FileHash::Report - Generate reports from a FileHash.


FileHash documentation  | view source Contained in the FileHash distribution.

Index


NAME

Top

 FileHash::Report - Generate reports from a FileHash.

SYNOPSIS

Top

 use FileHash::Report;
 $obj  = FileHash::Report->new;
 $obj  = $obj->all         ($filehash,$report,$fmtflg)

Inheritance

Top

 UNIVERSAL

Description

Top

 Write simple reports. The output data is printed in search key/bucket order.

Examples

Top

 use FileHash::Content;
 use FileHash::Report;

 my $r = FileHash::Report->new;
 my $a = FileHash::Content->alloc;
         $a->initFromTree ("/root");

 # print a list of all sets of files with the same md5sum and size.
 my $c = $a->identical;
         $r->all ($c,"myreport");

 # Hash the data by name instead.
 my $b = FileHash::Name->alloc;
         $b->initFromTree ($a);

 # print a list of all sets of files with the same file name.
    $c = $b->identical;
         $r->all ($c,"myreport2");

 # Print a list of all files found in a that are not in b
    $a = FileHash::Content->alloc; 
    $b = FileHash::Content->alloc; 
         $a->initFromTree ("/home/me/tree1");
         $b->initFromTree ("/home/me/tree2");
    $c = $a->andnot ($b);
         $r->all ($c,"myreport3");

 # Print a list of all files found in a that are in one or the
 # other but not both.
 my $c = $a->xor ($b);
         $r->all ($c,"myreport3");

Class Variables

Top

 None.

Instance Variables

Top

 None.

Class Methods

Top

$obj = FileHash::Report->new

Create instances of FileHash::Report.

Instance Methods

Top

Methods return self on success and undef on error unless stated otherwise.

A 'group of files' are files that have the same hash key.

$obj = $obj->all ($filehash,$report,$fmtflg)

Write a report of all files in $filehash to a file named $report. If the format flag exists and is true, linefeeds are printed between each group on output.

Private Class Method

Top

 None.

Private Instance Methods

Top

 None.

Errors and Warnings

Top

 Lots.

KNOWN BUGS

Top

 See TODO.

SEE ALSO

Top

 FileHash::Base, Fault::Logger.

AUTHOR

Top

Dale Amon <amon@vnl.com>


FileHash documentation  | view source Contained in the FileHash distribution.