A TarInfo object represents one member in a TarFile. Aside from storing all required attributes of a file (like file type, size, time, permissions, owner etc.), it provides some useful methods to determine its type. It does not contain the file's data itself.
TarInfo objects are returned by TarFile
's methods
getmember()
, getmembers()
and gettarinfo()
.
[name]) |
) |
) |
A TarInfo
object has the following public data attributes:
REGTYPE, AREGTYPE, LNKTYPE, SYMTYPE, DIRTYPE, FIFOTYPE, CONTTYPE,
CHRTYPE, BLKTYPE, GNUTYPE_SPARSE
.
To determine the type of a TarInfo object more conveniently, use
the is_*()
methods below.
A TarInfo object also provides some convenient query methods:
) |
True
if the Tarinfo object is a regular file.
) |
) |
True
if it is a directory.
) |
True
if it is a symbolic link.
) |
True
if it is a hard link.
) |
True
if it is a character device.
) |
True
if it is a block device.
) |
True
if it is a FIFO.
) |
True
if it is one of character device, block device or FIFO.
See About this document... for information on suggesting changes.