tar interface

D

David Bear

I just googled for a 'python tar interface module' and got over 33000
hits. ug.

I'm looking for a python module that either interfaces to gnutar in a
pythonic way or reads/writes tar files directly. I know there's
always os.popoen etc, but was hoping for something a little more ..

--
David Bear
phone: 480-965-8257
fax: 480-965-9189
College of Public Programs/ASU
Wilson Hall 232
Tempe, AZ 85287-0803
"Beware the IP portfolio, everyone will be suspect of trespassing"
 
G

Gary Herron

I just googled for a 'python tar interface module' and got over 33000
hits. ug.

I'm looking for a python module that either interfaces to gnutar in a
pythonic way or reads/writes tar files directly. I know there's
always os.popoen etc, but was hoping for something a little more ..

Python 2.3 has a module named tarfile that provides tar functionality
as well as some of the gnu extensions to tar. It does not interface
with any external implementation of tar, put provides its own.

Here is an excerpt from its documentation:


tarfile -- Read and write tar archive files

New in version 2.3.

The tarfile module makes it possible to read and create tar
archives. Some facts and figures:

* reads and writes gzip and bzip2 compressed archives.

* creates POSIX 1003.1-1990 compliant or GNU tar compatible archives.

* reads GNU tar extensions longname, longlink and sparse.

* stores pathnames of unlimited length using GNU tar extensions.

* handles directories, regular files, hardlinks, symbolic links,
fifos, character devices and block devices and is able to acquire
and restore file information like timestamp, access permissions and
owner.

* can handle tape devices.


Hope that works for you,

Gary Herron
 
F

Fredrik Lundh

David said:
I just googled for a 'python tar interface module' and got over 33000
hits. ug.

you're supposed to use import, not google:

$ python
Python 2.3.2Help on module tarfile:

NAME
tarfile - Read from and write to tar format archives.

FILE
c:\python23\lib\tarfile.py

CLASSES
exceptions.Exception
TarError
CompressionError
ExtractError
ReadError
StreamError
TarFileCompat
TarIter
__builtin__.object
ExFileObject
TarFile
TarInfo

if you have an earlier Python version, see this page:

http://www.gustaebel.de/lars/tarfile/

</F>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,989
Messages
2,570,207
Members
46,783
Latest member
RickeyDort

Latest Threads

Top