FileHash::Entry - Container for data about a file.
use FileHash::Entry; $obj = FileHash::Entry->alloc; $ver = FileHash::Entry->dumpversion; $obj = $obj->init ($path); $obj = $obj->initFromStat ($path); $obj = $obj->initFromLine ($format,$line); $obj = $obj->initFromDump ($fh); $str = $obj->sprint; $obj = $obj->print; $obj = $obj->fprint($fh); $obj = $obj->dump ($fh); $path = $obj->path; $atime = $obj->atime; $blocksizePreference = $obj->blocksizePreference; $blocksAllocated = $obj->blocksAllocated; $ctime = $obj->ctime; $device = $obj->device; $deviceNumber = $obj->deviceNumber; $deviceSpecialId = $obj->deviceSpecialId; $directory = $obj->directory; $file = $obj->file; $gid = $obj->gid; $gidName = $obj->gidName; $hardlinks = $obj->hardlinks; $inode = $obj->inode; $md5sum = $obj->md5sum; $mode = $obj->mode; $mtime = $obj->mtime; $sizeBytes = $obj->sizeBytes; $uid = $obj->uid; $uidName = $obj->uidName;
This is an internal class used by FileHashes.
Entry objects are containers for information about files collected from various sources.
use FileHash::Entry; # Create an entry by collecting metadata about a live file. my $a = FileHash::Entry->alloc; $a->initFromStat ("/root/myfile"); # Create another Entry by parsing a line of data. my $f = FileHash::FormatString->alloc; $f->init ("path md5sum sizeBytes"); my $b = FileHash::Entry->alloc; $b->initFromLine ($f, "/root/myfile 0bdebef6bc59cabe489442ef9ddecf5f 10050"); # Dump the object data to a file. open $fh, ">mydump"; $b->dump ($fh); close $fh; # Reload the dumped object data. my $c = FileHash::Entry->alloc; open $fh, "<mydump"; $c->initFromDump ($fh); close $fh; # print data on the console. $c->print;
None.
In most cases an item will be undef if it is not available via the source of information used to create the FileHash::Entry.
device File device portion of file path, non Unix systems. directory File directory portion of file path. file File name portion of file path. deviceNumber Device number. sizeBytes Size of file in bytes. uid User id number. uidName User name in ascii. gid Group id number. gidName Group name in ascii. mode File access mode integer. atime Access time in nonleap seconds since 19700101 UTC. mtime Modify time in nonleap seconds since 19700101 UTC. ctime Create time in nonleap seconds since 19700101 UTC. inode File Inode number. hardlinks Number of hard links to file. deviceSpecialId Device special id, integer. blocksizePreference Preferred block size in bytes. blocksAllocated Number of blocks allocated to the file. md5sum md5sum of file content. notepad A Notepad object to record unusual events.
Allocate an empty FileHash Entry object.
Return the FileHash Entry dump format version id.
Return the file atime or 0 if not known.
Return the file blocksizePreference or "undef" if not known.
Return the file blocksAllocated or "undef" if not known.
Return the file ctime or 0 if not known.
Return the file device or "" if not known.
Return the file deviceNumber or "undef" if not known.
Return the file deviceSpecialId or "undef" if not known.
Return the file directory or "" if not known.
Return the file name or "" if not known.
Return the file gid or "undef" if not known.
return the file gidName or "undef" if not known.
Return the file hardlinks or "undef" if not known.
Return the file inodes or "undef" if not known.
Return the file md5sum or "undef" if not known.
Return the file mode or "undef" if not known.
Return the file mtime or 0 if not known.
Return the file size in bytes or 0 if not known.
Return the file uid or "undef" if not known.
Return the file uidName or "undef" if not known.
Dump contents of the file data entry to one line in the specified file defined by the opened file handle $fh.
Synonym for fprint.
Synonym for dump.
Initialize a FileHash Entry object to contain the path name.
Replace the alloc'd object with one recreated from a line of dump file data.
Create a FileHash Entry from the information parsed out of a line of text. A format object defines what information is contained in that line.
Initialized an object with metadata collected via a 'stat' and 'md5sum' applied to the file at $path.
Return the full path name.
Dump contents of the file data entry as one line on stdout.
Dump contents of the file data entry as a string. The string is not terminated by a newline.
This is the point at which the field data is split it needs to handle a mix of blank delimited fields and quoted fields. If want to parse lines of code here, you'll just have to write your own subclass and override this method.
Lots.
See TODO.
File::Spec, Digest::MD5, Fault::Notepad, Fault::Logger, FileHash::FormatString, Data::Dumper.
Dale Amon <amon@vnl.com>
5 POD Errors
The following errors were encountered while parsing the POD:
=back doesn't take any parameters, but you said =back 4
'=item' outside of any '=over'
You forgot a '=back' before '=head1'
To install FileHash::Base, copy and paste the appropriate command in to your terminal.
cpanm
cpanm FileHash::Base
CPAN shell
perl -MCPAN -e shell install FileHash::Base
For more information on module installation, please visit the detailed CPAN module installation guide.