File::Properties::Compressed - Perl module representing properties of a compressed file
use File::Properties::Cache; use File::Properties::Compressed; my $fpc = File::Properties::Compressed->cache('cache.db'); my $fpr = File::Properties::Compressed->new('/path/to/file', $fpc); print "Content digest: " . $fpr->cdigest . "\n";
File::Properties::Compressed is a Perl module representing properties of a gzip or bzip2 compressed file; specifically, the mime type and SHA-2 digest of the uncompressed content, in addition to the properties stored in File::Properties::Regular from which it is derived.
File::Properties::Compressed is a Perl module representing properties of a gzip or bzip2 compressed file; specifically, the mime type and SHA-2 digest of the uncompressed content, in addition to the properties stored in File::Properties::Regular from which it is derived. If a reference to a File::Properties::Cache object is specified in the constructor, access to the properties is via the cache.
my $fpr = File::Properties::Compressed->new($path, $fpc);
Constructs a new File::Properties::Compressed object.
print "Content mime type: " . $fpr->cmimetype . "\n";
Determine the file content mime type of the represented file.
print "Content digest: " . $fpr->cdigest . "\n";
Determine the file content digest for the represented file.
my $fh = $fpr->cfilehandle;
Get file handle to the represented file, or to a temporary file containing the uncompressed content if file is a gzip or bzip2 compressed file.
print "Is a compressed file\n" if ($fpr->iscompressed);
Determine whether the file is a gzip or bzip2 compressed file.
print $fpr->string . "\n";
Construct a string representing the object data.
$fpr->_cacheinit($fpc, $options_hash);
Initialise the regular file properties cache table in the cache referred to by the File::Properties::Cache reference argument.
File::Properties, File::Properties::Cache, File::Properties::Regular
Brendt Wohlberg <wohl@cpan.org>
Copyright (C) 2010,2011 by Brendt Wohlberg
This library is available under the terms of the GNU General Public License (GPL), described in the LICENSE file included in this distribution.
To install File::Properties, copy and paste the appropriate command in to your terminal.
cpanm
cpanm File::Properties
CPAN shell
perl -MCPAN -e shell install File::Properties
For more information on module installation, please visit the detailed CPAN module installation guide.