Archive::Libarchive::Entry - Libarchive entry class
version 0.09
use 5.020; use Archive::Libarchive; my $text = "Hello World!\n"; my $e = Archive::Libarchive::Entry->new; $e->set_pathname("hello.txt"); $e->set_filetype('reg'); $e->set_size(length $text); $e->set_mtime(time); $e->set_mode(oct('0644'));
This class represents an entry, which is file metadata for a file stored in an archive or on the local file system.
This is a subset of total list of methods available to all archive classes. For the full list see "Archive::Libarchive::Entry" in Archive::Libarchive::API.
my $e = Archive::Libarchive::Entry->new;
Create a new Entry object.
This is a subset of total list of methods available to all archive classes. For the full list see "Archive::Libarchive::Entry" in Archive::Libarchive::API.
# archive_entry_filetype my $code = $e->filetype;
This returns the type of file for the entry. This will be a dualvar where the string is one of mt
, reg
, lnx
, sock
, chr
, blk
, dir
or ifo
, and integer values will match the corresponding AE_IF
prefixed constant. See "CONSTANTS" in Archive::Libarchive::API for the full list.
# archive_entry_set_filetype $e->set_filetype($code);
This sets the type of the file for the entry. This will accept either a string value which is one of mt
, reg
, lnx
, sock
, chr
, blk
, dir
or ifo
, or an integer constant value with the AE_IF
prefix. See "CONSTANTS" in Archive::Libarchive::API for the full list.
# archive_entry_digest my $string = $e->digest($type);
This is used to query the raw hex digest for the given entry. The type of digest is provided as an argument. The type may be passed in as either a string or an integer constant. The constant prefix is ARCHIVE_ENTRY_DIGEST_
. So for an MD5 digest you could pass in either 'md5'
or ARCHIVE_ENTRY_DIGEST_MD5
.
# archive_entry_xattr_add_entry my $int = $e->xattr_add_entry($name, $value);
Adds an xattr name/value pair.
# archive_entry_xattr_next my $int = $e->xattr_next(\$name, $value);
Fetches the next xattr name/value pair.
# archive_entry_copy_stat $e->copy_stat($stat);
Copies the values from a FFI::C::Stat instance.
Not currently implemented on Windows.
# archive_entry_stat my $stat = $e->stat;
Returns a FFI::C::Stat instance filled out from the entry metadata.
Not currently implemented on Windows.
# archive_entry_clone my $e2 = $e->clone;
Clone the entry instance.
# archive_entry_copy_mac_metadata $e->copy_mac_metadata($meta);
Sets the mac metadata to $meta
.
# archive_entry_mac_metadata my $meta = $e->mac_metadata;
Get the mac metadata from the entry.
Provides an interface for listing and retrieving entries from an archive without extracting them to the local filesystem.
Provides an interface for extracting arbitrary archives of any format/filter supported by libarchive
.
Decompresses / unwraps files that have been compressed or wrapped in any of the filter formats supported by libarchive
This is the main top-level module for using libarchive
from Perl. It is the best place to start reading the documentation. It pulls in the other classes and libarchive
constants so that you only need one use
statement to effectively use libarchive
.
This contains the full and complete API for all of the Archive::Libarchive classes. Because libarchive
has hundreds of methods, the main documentation pages elsewhere only contain enough to be useful, and not to overwhelm.
The base class of all archive classes. This includes some common error reporting functionality among other things.
This class is used for reading from archives.
This class is for creating new archives.
This class is for reading Archive::Libarchive::Entry objects from disk so that they can be written to Archive::Libarchive::ArchiveWrite objects.
This class is for writing Archive::Libarchive::Entry objects to disk that have been written from Archive::Libarchive::ArchiveRead objects.
This class exposes the libarchive
link resolver API.
This class exposes the libarchive
match API.
Build Dist::Zilla based dist tarballs with libarchive instead of the built in Archive::Tar.
If a suitable system libarchive
can't be found, then this Alien will be installed to provide it.
The libarchive
project home page.
The libarchive
project wiki.
Some of the libarchive
man pages are listed here.
Graham Ollis <plicease@cpan.org>
This software is copyright (c) 2021,2022 by Graham Ollis.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.