tarfile and end-of-tape

Lars Gustaebel lars at gustaebel.de
Tue Aug 5 12:58:39 CEST 2003

On Mon, 04 Aug 2003 15:29:34 -0500, Josh Smith wrote:

> In Python 2.3  there is a new library for handling tarfiles.  However,
> there doesn't seem to be any documentation on handling end-of-tape
> conditions.  I've googled for it and checked the docs, I've even looked
> into the modules src and all I found was an end of file exception that
> might do what I'm looking for, but might not.

Tape device support is implemented only rudimentarily in tarfile because
that is not its focus. End-of-tape conditions are not specially handled
except that you get the typical system errors if you try to write on a
full medium.
Please note that tarfile.open() takes an optional fileobj argument which
you could use to pass a custom file-like object that sits between tarfile
and your tape device.

> Anyone have any pointers/help?

More information about the Python-list mailing list