MOON
Server: Apache/2.2.31 (Unix) mod_ssl/2.2.31 OpenSSL/0.9.8e-fips-rhel5 mod_bwlimited/1.4
System: Linux csr818.wilogic.com 2.6.18-419.el5xen #1 SMP Fri Feb 24 22:50:37 UTC 2017 x86_64
User: digitals (531)
PHP: 5.4.45
Disabled: NONE
Upload Files
File: //usr/share/doc/python-docs-2.4.3/html/lib/tarinfo-objects.html
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<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>
</head>
<body>
<DIV CLASS="navigation">
<div id='top-navigation-panel' xml:id='top-navigation-panel'>
<table align="center" width="100%" cellpadding="0" cellspacing="2">
<tr>
<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>
</tr></table>
<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>
</div>
<hr /></div>
</DIV>
<!--End of Navigation Panel-->

<H2><A NAME="SECTION0091920000000000000000"></A><A NAME="tarinfo-objects"></A>
<BR>
7.19.2 TarInfo Objects 
</H2>

<P>
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
the file's data itself.

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

<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
  <td><nobr><b><span class="typelabel">class</span>&nbsp;<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>
<dd>
    Create a <tt class="class">TarInfo</tt> object.
</dl>

<P>
<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>
<dd>
    Create and return a <tt class="class">TarInfo</tt> object from a string buffer.
</dl>

<P>
<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>
<dd>
    Create a string buffer from a <tt class="class">TarInfo</tt> object.
</dl>

<P>
A <code>TarInfo</code> object has the following public data attributes:

<P>
<dl><dt><b><tt id='l2h-2921' xml:id='l2h-2921' class="member">name</tt></b></dt>
<dd>
    Name of the archive member.
</dl>

<P>
<dl><dt><b><tt id='l2h-2922' xml:id='l2h-2922' class="member">size</tt></b></dt>
<dd>
    Size in bytes.
</dl>

<P>
<dl><dt><b><tt id='l2h-2923' xml:id='l2h-2923' class="member">mtime</tt></b></dt>
<dd>
    Time of last modification.
</dl>

<P>
<dl><dt><b><tt id='l2h-2924' xml:id='l2h-2924' class="member">mode</tt></b></dt>
<dd>
    Permission bits.
</dl>

<P>
<dl><dt><b><tt id='l2h-2925' xml:id='l2h-2925' class="member">type</tt></b></dt>
<dd>
    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>
    methods below.
</dl>

<P>
<dl><dt><b><tt id='l2h-2926' xml:id='l2h-2926' class="member">linkname</tt></b></dt>
<dd>
    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>

<P>
<dl><dt><b><tt id='l2h-2927' xml:id='l2h-2927' class="member">uid</tt></b></dt>
<dd>
    User ID of the user who originally stored this member.
</dl>

<P>
<dl><dt><b><tt id='l2h-2928' xml:id='l2h-2928' class="member">gid</tt></b></dt>
<dd>
    Group ID of the user who originally stored this member.
</dl>

<P>
<dl><dt><b><tt id='l2h-2929' xml:id='l2h-2929' class="member">uname</tt></b></dt>
<dd>
    User name.
</dl>

<P>
<dl><dt><b><tt id='l2h-2930' xml:id='l2h-2930' class="member">gname</tt></b></dt>
<dd>
    Group name.
</dl>

<P>
A <tt class="class">TarInfo</tt> object also provides some convenient query methods:

<P>
<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>
<dd>
    Return <tt class="constant">True</tt> if the <tt class="class">Tarinfo</tt> object is a regular
    file.
</dl>

<P>
<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>
<dd>
    Same as <tt class="method">isfile()</tt>.
</dl>

<P>
<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>
<dd>
    Return <tt class="constant">True</tt> if it is a directory.
</dl>

<P>
<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>
<dd>
    Return <tt class="constant">True</tt> if it is a symbolic link.
</dl>

<P>
<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>
<dd>
    Return <tt class="constant">True</tt> if it is a hard link.
</dl>

<P>
<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>
<dd>
    Return <tt class="constant">True</tt> if it is a character device.
</dl>

<P>
<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>
<dd>
    Return <tt class="constant">True</tt> if it is a block device.
</dl>

<P>
<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>
<dd>
    Return <tt class="constant">True</tt> if it is a FIFO.
</dl>

<P>
<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>
<dd>
    Return <tt class="constant">True</tt> if it is one of character device, block
    device or FIFO.
</dl>

<P>

<DIV CLASS="navigation">
<div class='online-navigation'>
<p></p><hr />
<table align="center" width="100%" cellpadding="0" cellspacing="2">
<tr>
<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>
</tr></table>
<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>
</div>
</div>
<hr />
<span class="release-info">Release 2.4.3, documentation updated on 29 March 2006.</span>
</DIV>
<!--End of Navigation Panel-->
<ADDRESS>
See <i><a href="about.html">About this document...</a></i> for information on suggesting changes.
</ADDRESS>
</BODY>
</HTML>