The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

File::Properties::Compressed - Perl module representing properties of a compressed file

SYNOPSIS

  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";

ABSTRACT

  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.

DESCRIPTION

  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.
new
  my $fpr = File::Properties::Compressed->new($path, $fpc);

Constructs a new File::Properties::Compressed object.

cmimetype
  print "Content mime type: " . $fpr->cmimetype . "\n";

Determine the file content mime type of the represented file.

cdigest
  print "Content digest: " . $fpr->cdigest . "\n";

Determine the file content digest for the represented file.

cfilehandle
  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.

iscompressed
  print "Is a compressed file\n" if ($fpr->iscompressed);

Determine whether the file is a gzip or bzip2 compressed file.

string
  print $fpr->string . "\n";

Construct a string representing the object data.

_cacheinit
  $fpr->_cacheinit($fpc, $options_hash);

Initialise the regular file properties cache table in the cache referred to by the File::Properties::Cache reference argument.

SEE ALSO

File::Properties, File::Properties::Cache, File::Properties::Regular

AUTHOR

Brendt Wohlberg <wohl@cpan.org>

COPYRIGHT AND LICENSE

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.