tarfile.TarInfo

class tarfile.TarInfo(name='')[source]

Informational class which holds the details about an archive member given by a tar header block. TarInfo objects are returned by TarFile.getmember(), TarFile.getmembers() and TarFile.gettarinfo() and are usually created internally.

Methods

__format__ default object formatter
__init__([name]) Construct a TarInfo object.
__new__((S, ...)
__reduce__ helper for pickle
__reduce_ex__ helper for pickle
__repr__()
__sizeof__(() -> int) size of object in memory, in bytes
__subclasshook__ Abstract classes can override this to customize issubclass().
_apply_pax_info(pax_headers, encoding, errors) Replace fields with supplemental information from a previous pax extended or global header.
_block(count) Round up a byte count by BLOCKSIZE and return it, e.g.
_create_gnu_long_header(name, type) Return a GNUTYPE_LONGNAME or GNUTYPE_LONGLINK sequence for name.
_create_header(info, format) Return a header block.
_create_pax_generic_header(pax_headers[, type]) Return a POSIX.1-2001 extended or global header sequence that contains a list of keyword, value pairs.
_create_payload(payload) Return the string payload filled with zero bytes up to the next 512 byte border.
_getlinkpath()
_getpath()
_posix_split_name(name) Split a name longer than 100 chars into a prefix and a name part.
_proc_builtin(tarfile) Process a builtin type or an unknown type which will be treated as a regular file.
_proc_gnulong(tarfile) Process the blocks that hold a GNU longname or longlink member.
_proc_member(tarfile) Choose the right processing method depending on the type and call it.
_proc_pax(tarfile) Process an extended or global header as described in POSIX.1-2001.
_proc_sparse(tarfile) Process a GNU sparse header plus extra headers.
_setlinkpath(linkname)
_setpath(name)
create_gnu_header(info) Return the object as a GNU header block sequence.
create_pax_global_header(pax_headers) Return the object as a pax global header block sequence.
create_pax_header(info, encoding, errors) Return the object as a ustar header block.
create_ustar_header(info) Return the object as a ustar header block.
frombuf(buf) Construct a TarInfo object from a 512 byte string buffer.
fromtarfile(tarfile) Return the next TarInfo object from TarFile object tarfile.
get_info(encoding, errors) Return the TarInfo’s attributes as a dictionary.
isblk()
ischr()
isdev()
isdir()
isfifo()
isfile()
islnk()
isreg()
issparse()
issym()
tobuf([format, encoding, errors]) Return a tar header as a string of 512 byte blocks.

Attributes

linkpath
path