Archive::Libarchive::Entry(3)

NAME
Archive::Libarchive::Entry - Libarchive entry class

VERSION
version 0.09

SYNOPSIS
 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'));

DESCRIPTION
This class represents an entry, which is file metadata for a file stored in an archive or on the local file system.

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

  new
 my $e = Archive::Libarchive::Entry->new;

Create a new Entry object.

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

  filetype
 # 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.

  set_filetype
 # 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.

  digest
 # 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".

  xattr_add_entry
 # archive_entry_xattr_add_entry
 my $int = $e->xattr_add_entry($name, $value);

Adds an xattr name/value pair.

  xattr_next
 # archive_entry_xattr_next
 my $int = $e->xattr_next(\$name, $value);

Fetches the next xattr name/value pair.

  copy_stat
 # archive_entry_copy_stat
 $e->copy_stat($stat);

Copies the values from a FFI::C::Stat instance.

Not currently implemented on Windows.

  stat
 # archive_entry_stat
 my $stat = $e->stat;

Returns a FFI::C::Stat instance filled out from the entry metadata.

Not currently implemented on Windows.

  clone
 # archive_entry_clone
 my $e2 = $e->clone;

Clone the entry instance.

  copy_mac_metadata
 # archive_entry_copy_mac_metadata
 $e->copy_mac_metadata($meta);

Sets the mac metadata to $meta.

  mac_metadata
 # archive_entry_mac_metadata
 my $meta = $e->mac_metadata;

Get the mac metadata from the entry.

SEE ALSO

Archive::Libarchive::Peek
    Provides an interface for listing and retrieving entries from an archive without extracting them to the local filesystem.

Archive::Libarchive::Extract
    Provides an interface for extracting arbitrary archives of any format/filter supported by "libarchive".

Archive::Libarchive::Unwrap
    Decompresses / unwraps files that have been compressed or wrapped in any of the filter formats supported by "libarchive"

Archive::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".

Archive::Libarchive::API
    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.

Archive::Libarchive::Archive
    The base class of all archive classes. This includes some common error reporting functionality among other things.

Archive::Libarchive::ArchiveRead
    This class is used for reading from archives.

Archive::Libarchive::ArchiveWrite
    This class is for creating new archives.

Archive::Libarchive::DiskRead
    This class is for reading Archive::Libarchive::Entry objects from disk so that they can be written to Archive::Libarchive::ArchiveWrite objects.

Archive::Libarchive::DiskWrite
    This class is for writing Archive::Libarchive::Entry objects to disk that have been written from Archive::Libarchive::ArchiveRead objects.

Archive::Libarchive::EntryLinkResolver
    This class exposes the "libarchive" link resolver API.

Archive::Libarchive::Match
    This class exposes the "libarchive" match API.

Dist::Zilla::Plugin::Libarchive
    Build Dist::Zilla based dist tarballs with libarchive instead of the built in Archive::Tar.

Alien::Libarchive3
    If a suitable system "libarchive" can't be found, then this Alien will be installed to provide it.

libarchive.org <http://libarchive.org/>
    The "libarchive" project home page.

<https://github.com/libarchive/libarchive/wiki>
    The "libarchive" project wiki.

<https://github.com/libarchive/libarchive/wiki/ManualPages>
    Some of the "libarchive" man pages are listed here.

AUTHOR
Graham Ollis <plicease@cpan.org>

COPYRIGHT AND LICENSE
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.