<!DOCTYPE html PUBLIC
"-//W3C//DTD HTML 4.0 Transitional//EN">
<link rel=
"STYLESHEET" href=
"lib.css" type='text/css'
/>
<link rel=
"SHORTCUT ICON" href=
"../icons/pyfav.png" type=
"image/png" />
<link rel='start' href='../index.html' title='Python Documentation Index'
/>
<link rel=
"first" href=
"lib.html" title='Python Library Reference'
/>
<link rel='contents' href='contents.html'
title=
"Contents" />
<link rel='index' href='genindex.html' title='Index'
/>
<link rel='last' href='about.html' title='About this document...'
/>
<link rel='help' href='about.html' title='About this document...'
/>
<link rel=
"next" href=
"tar-examples.html" />
<link rel=
"prev" href=
"tarfile-objects.html" />
<link rel=
"parent" href=
"module-tarfile.html" />
<link rel=
"next" href=
"tar-examples.html" />
<meta name='aesop' content='information'
/>
<title>7.19.2 TarInfo Objects
</title>
<div id='top-navigation-panel' xml:id='top-navigation-panel'
>
<table align=
"center" width=
"100%" cellpadding=
"0" cellspacing=
"2">
<td class='online-navigation'
><a rel=
"prev" title=
"7.19.1 TarFile Objects"
href=
"tarfile-objects.html"><img src='../icons/previous.png'
border='
0' height='
32' alt='Previous Page' width='
32'
/></A></td>
<td class='online-navigation'
><a rel=
"parent" title=
"7.19 tarfile "
href=
"module-tarfile.html"><img src='../icons/up.png'
border='
0' height='
32' alt='Up One Level' width='
32'
/></A></td>
<td class='online-navigation'
><a rel=
"next" title=
"7.19.3 Examples"
href=
"tar-examples.html"><img src='../icons/next.png'
border='
0' height='
32' alt='Next Page' width='
32'
/></A></td>
<td align=
"center" width=
"100%">Python Library Reference
</td>
<td class='online-navigation'
><a rel=
"contents" title=
"Table of Contents"
href=
"contents.html"><img src='../icons/contents.png'
border='
0' height='
32' alt='Contents' width='
32'
/></A></td>
<td class='online-navigation'
><a href=
"modindex.html" title=
"Module Index"><img src='../icons/modules.png'
border='
0' height='
32' alt='Module Index' width='
32'
/></a></td>
<td class='online-navigation'
><a rel=
"index" title=
"Index"
href=
"genindex.html"><img src='../icons/index.png'
border='
0' height='
32' alt='Index' width='
32'
/></A></td>
<div class='online-navigation'
>
<b class=
"navlabel">Previous:
</b>
<a class=
"sectref" rel=
"prev" href=
"tarfile-objects.html">7.19.1 TarFile Objects
</A>
<b class=
"navlabel">Up:
</b>
<a class=
"sectref" rel=
"parent" href=
"module-tarfile.html">7.19 tarfile
</A>
<b class=
"navlabel">Next:
</b>
<a class=
"sectref" rel=
"next" href=
"tar-examples.html">7.19.3 Examples
</A>
<!--End of Navigation Panel-->
<H2><A NAME=
"SECTION0091920000000000000000"></A><A NAME=
"tarinfo-objects"></A>
A
<tt class=
"class">TarInfo
</tt> object represents one member in a
<tt class=
"class">TarFile
</tt>. 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
<em>not
</em> contain
<tt class=
"class">TarInfo
</tt> objects are returned by
<tt class=
"class">TarFile
</tt>'s methods
<tt class=
"method">getmember()
</tt>,
<tt class=
"method">getmembers()
</tt> and
<tt class=
"method">gettarinfo()
</tt>.
<dl><dt><table cellpadding=
"0" cellspacing=
"0"><tr valign=
"baseline">
<td><nobr><b><span class=
"typelabel">class
</span> <tt id='l2h-
2918' xml:id='l2h-
2918'
class=
"class">TarInfo
</tt></b>(
</nobr></td>
<td><var></var><big>[
</big><var>name
</var><big>]
</big><var></var>)
</td></tr></table></dt>
Create a
<tt class=
"class">TarInfo
</tt> object.
<dl><dt><table cellpadding=
"0" cellspacing=
"0"><tr valign=
"baseline">
<td><nobr><b><tt id='l2h-
2919' xml:id='l2h-
2919'
class=
"method">frombuf
</tt></b>(
</nobr></td>
<td><var></var>)
</td></tr></table></dt>
Create and return a
<tt class=
"class">TarInfo
</tt> object from a string buffer.
<dl><dt><table cellpadding=
"0" cellspacing=
"0"><tr valign=
"baseline">
<td><nobr><b><tt id='l2h-
2920' xml:id='l2h-
2920'
class=
"method">tobuf
</tt></b>(
</nobr></td>
<td><var></var>)
</td></tr></table></dt>
Create a string buffer from a
<tt class=
"class">TarInfo
</tt> object.
A
<code>TarInfo
</code> object has the following public data attributes:
<dl><dt><b><tt id='l2h-
2921' xml:id='l2h-
2921'
class=
"member">name
</tt></b></dt>
Name of the archive member.
<dl><dt><b><tt id='l2h-
2922' xml:id='l2h-
2922'
class=
"member">size
</tt></b></dt>
<dl><dt><b><tt id='l2h-
2923' xml:id='l2h-
2923'
class=
"member">mtime
</tt></b></dt>
Time of last modification.
<dl><dt><b><tt id='l2h-
2924' xml:id='l2h-
2924'
class=
"member">mode
</tt></b></dt>
<dl><dt><b><tt id='l2h-
2925' xml:id='l2h-
2925'
class=
"member">type
</tt></b></dt>
File type.
<var>type
</var> is usually one of these constants:
<tt class=
"constant">REGTYPE
</tt>,
<tt class=
"constant">AREGTYPE
</tt>,
<tt class=
"constant">LNKTYPE
</tt>,
<tt class=
"constant">SYMTYPE
</tt>,
<tt class=
"constant">DIRTYPE
</tt>,
<tt class=
"constant">FIFOTYPE
</tt>,
<tt class=
"constant">CONTTYPE
</tt>,
<tt class=
"constant">CHRTYPE
</tt>,
<tt class=
"constant">BLKTYPE
</tt>,
<tt class=
"constant">GNUTYPE_SPARSE
</tt>. To determine the type of a
<tt class=
"class">TarInfo
</tt> object more conveniently, use the
<code>is_*()
</code>
<dl><dt><b><tt id='l2h-
2926' xml:id='l2h-
2926'
class=
"member">linkname
</tt></b></dt>
Name of the target file name, which is only present in
<tt class=
"class">TarInfo
</tt> objects of type
<tt class=
"constant">LNKTYPE
</tt> and
<tt class=
"constant">SYMTYPE
</tt>.
<dl><dt><b><tt id='l2h-
2927' xml:id='l2h-
2927'
class=
"member">uid
</tt></b></dt>
User ID of the user who originally stored this member.
<dl><dt><b><tt id='l2h-
2928' xml:id='l2h-
2928'
class=
"member">gid
</tt></b></dt>
Group ID of the user who originally stored this member.
<dl><dt><b><tt id='l2h-
2929' xml:id='l2h-
2929'
class=
"member">uname
</tt></b></dt>
<dl><dt><b><tt id='l2h-
2930' xml:id='l2h-
2930'
class=
"member">gname
</tt></b></dt>
A
<tt class=
"class">TarInfo
</tt> object also provides some convenient query methods:
<dl><dt><table cellpadding=
"0" cellspacing=
"0"><tr valign=
"baseline">
<td><nobr><b><tt id='l2h-
2931' xml:id='l2h-
2931'
class=
"method">isfile
</tt></b>(
</nobr></td>
<td><var></var>)
</td></tr></table></dt>
Return
<tt class=
"constant">True
</tt> if the
<tt class=
"class">Tarinfo
</tt> object is a regular
<dl><dt><table cellpadding=
"0" cellspacing=
"0"><tr valign=
"baseline">
<td><nobr><b><tt id='l2h-
2932' xml:id='l2h-
2932'
class=
"method">isreg
</tt></b>(
</nobr></td>
<td><var></var>)
</td></tr></table></dt>
Same as
<tt class=
"method">isfile()
</tt>.
<dl><dt><table cellpadding=
"0" cellspacing=
"0"><tr valign=
"baseline">
<td><nobr><b><tt id='l2h-
2933' xml:id='l2h-
2933'
class=
"method">isdir
</tt></b>(
</nobr></td>
<td><var></var>)
</td></tr></table></dt>
Return
<tt class=
"constant">True
</tt> if it is a directory.
<dl><dt><table cellpadding=
"0" cellspacing=
"0"><tr valign=
"baseline">
<td><nobr><b><tt id='l2h-
2934' xml:id='l2h-
2934'
class=
"method">issym
</tt></b>(
</nobr></td>
<td><var></var>)
</td></tr></table></dt>
Return
<tt class=
"constant">True
</tt> if it is a symbolic link.
<dl><dt><table cellpadding=
"0" cellspacing=
"0"><tr valign=
"baseline">
<td><nobr><b><tt id='l2h-
2935' xml:id='l2h-
2935'
class=
"method">islnk
</tt></b>(
</nobr></td>
<td><var></var>)
</td></tr></table></dt>
Return
<tt class=
"constant">True
</tt> if it is a hard link.
<dl><dt><table cellpadding=
"0" cellspacing=
"0"><tr valign=
"baseline">
<td><nobr><b><tt id='l2h-
2936' xml:id='l2h-
2936'
class=
"method">ischr
</tt></b>(
</nobr></td>
<td><var></var>)
</td></tr></table></dt>
Return
<tt class=
"constant">True
</tt> if it is a character device.
<dl><dt><table cellpadding=
"0" cellspacing=
"0"><tr valign=
"baseline">
<td><nobr><b><tt id='l2h-
2937' xml:id='l2h-
2937'
class=
"method">isblk
</tt></b>(
</nobr></td>
<td><var></var>)
</td></tr></table></dt>
Return
<tt class=
"constant">True
</tt> if it is a block device.
<dl><dt><table cellpadding=
"0" cellspacing=
"0"><tr valign=
"baseline">
<td><nobr><b><tt id='l2h-
2938' xml:id='l2h-
2938'
class=
"method">isfifo
</tt></b>(
</nobr></td>
<td><var></var>)
</td></tr></table></dt>
Return
<tt class=
"constant">True
</tt> if it is a FIFO.
<dl><dt><table cellpadding=
"0" cellspacing=
"0"><tr valign=
"baseline">
<td><nobr><b><tt id='l2h-
2939' xml:id='l2h-
2939'
class=
"method">isdev
</tt></b>(
</nobr></td>
<td><var></var>)
</td></tr></table></dt>
Return
<tt class=
"constant">True
</tt> if it is one of character device, block
<div class='online-navigation'
>
<table align=
"center" width=
"100%" cellpadding=
"0" cellspacing=
"2">
<td class='online-navigation'
><a rel=
"prev" title=
"7.19.1 TarFile Objects"
href=
"tarfile-objects.html"><img src='../icons/previous.png'
border='
0' height='
32' alt='Previous Page' width='
32'
/></A></td>
<td class='online-navigation'
><a rel=
"parent" title=
"7.19 tarfile "
href=
"module-tarfile.html"><img src='../icons/up.png'
border='
0' height='
32' alt='Up One Level' width='
32'
/></A></td>
<td class='online-navigation'
><a rel=
"next" title=
"7.19.3 Examples"
href=
"tar-examples.html"><img src='../icons/next.png'
border='
0' height='
32' alt='Next Page' width='
32'
/></A></td>
<td align=
"center" width=
"100%">Python Library Reference
</td>
<td class='online-navigation'
><a rel=
"contents" title=
"Table of Contents"
href=
"contents.html"><img src='../icons/contents.png'
border='
0' height='
32' alt='Contents' width='
32'
/></A></td>
<td class='online-navigation'
><a href=
"modindex.html" title=
"Module Index"><img src='../icons/modules.png'
border='
0' height='
32' alt='Module Index' width='
32'
/></a></td>
<td class='online-navigation'
><a rel=
"index" title=
"Index"
href=
"genindex.html"><img src='../icons/index.png'
border='
0' height='
32' alt='Index' width='
32'
/></A></td>
<div class='online-navigation'
>
<b class=
"navlabel">Previous:
</b>
<a class=
"sectref" rel=
"prev" href=
"tarfile-objects.html">7.19.1 TarFile Objects
</A>
<b class=
"navlabel">Up:
</b>
<a class=
"sectref" rel=
"parent" href=
"module-tarfile.html">7.19 tarfile
</A>
<b class=
"navlabel">Next:
</b>
<a class=
"sectref" rel=
"next" href=
"tar-examples.html">7.19.3 Examples
</A>
<span class=
"release-info">Release
2.4.2, documentation updated on
28 September
2005.
</span>
<!--End of Navigation Panel-->
See
<i><a href=
"about.html">About this document...
</a></i> for information on suggesting changes.