NAME

Archive::SevenZip::Entry - a member of an archive

SYNOPSIS

use POSIX 'strftime';
for my $entry ( $ar->list ) {
    print $entry->fileName,"\n";
    print strftime('%Y-%m-%d %H:%M', gmtime($entry->lastModTime)),"\n";
    my $content = $entry->slurp();
    print $content;
};

METHODS

->archive
my $ar = $entry->archive();

Returns the containing archive as an Archive::SevenZip object.

->fileName
my $fn = $entry->fileName();

Returns the stored path

->basename
my $fn = $entry->basename();

Returns the stored filename without a directory

->components
my @parts = $entry->components();

Returns the stored filename as an array of directory names and the file name

->lastModTime
my $epoch = $entry->lastModTime();
print strftime('%Y-%m-%d %H:%M', $epoch),"\n";

Returns the time of last modification of the stored file as number of seconds

->uncompressedSize
my $size = $entry->uncompressedSize();

Returns the uncompressed size of the stored file in bytes

->open $binmode
my $fh = $entry->open(':raw');

Opens a filehandle for the uncompressed data

->fh $binmode
my $fh = $entry->fh(':raw');

Opens a filehandle for the uncompressed data

->slurp %options
my $content = $entry->slurp( iomode => ':raw');

Reads the content

->extractToFileNamed $name
$entry->extractToFileNamed( '/tmp/foo.txt' );

Extracts the data

REPOSITORY

The public repository of this module is https://github.com/Corion/archive-sevenzip.

SUPPORT

The public support forum of this module is https://perlmonks.org/.

BUG TRACKER

Please report bugs in this module via the RT CPAN bug queue at https://rt.cpan.org/Public/Dist/Display.html?Name=Archive-SevenZip or via mail to archive-sevenzip-Bugs@rt.cpan.org.

AUTHOR

Max Maischein corion@cpan.org

COPYRIGHT (c)

Copyright 2015-2024 by Max Maischein corion@cpan.org.

LICENSE

This module is released under the same terms as Perl itself.