TarInfo Objects



TarInfo Objects store information about a TarFile entry. Their instances are returned by TarFile's methods getinfo(), infolist(), next() and in Iteration.

class TarInfo([filename[, date_time]])
Normally TarInfo instances are created by TarFile instances. In addition to that the user has the possibility to create them himself, for further use with TarFile's writestr(). filename is the wanted name of the file in the TarFile. date_time is a tuple of date and time, see below.

TarInfo class stores the following data attributes:

zipfile compatibles:

filename
The name of the entry in the archive as a string.

date_time
The date and time of the entry's last modification as a tuple of six values: (year, month, day, hour, minute, second)

file_size
The entry's size in bytes (as a long). Entries except REGTYPE, AREGTYPE and CONTTYPE have a size of 0.

tarfile specific
(most of them are only relevant for *NIX platforms):

mode
The entry's file permissions as an integer.

uid
The entry's user id as an integer.

gid
The entry's group id as an integer.

uname
The entry's user name as a string.

gname
The entry's group name as a string.

linkname
If entry is a link, this is the target as a string.

type
This is the entry's type. It is one of the constants defined on module level.



Copyright © 2002 Lars Gustäbel lars@gustaebel.de