Module tarfile :: Class ExFileObject
[hide private]
[frames] | no frames]

type ExFileObject

object --+
         |
        ExFileObject

File-like object for reading an archive member. Is returned by TarFile.extractfile(). Support for sparse files included.

Instance Methods [hide private]
 
__init__(self, tarfile, tarinfo)
 
__read(self, size)
Overloadable read method.
 
readline(self, size=-1)
Read a line with approx.
 
readlines(self)
Return a list with all (following) lines.
 
_readnormal(self, size=None)
Read operation for regular files.
 
_readsparse(self, size=None)
Read operation for sparse files.
 
_readsparsesection(self, size)
Read a single section of a sparse file.
 
tell(self)
Return the current file position.
 
seek(self, pos, whence=0)
Seek to a position in the file.
 
close(self)
Close the file object.
 
__iter__(self)
Get an iterator over the file object.
 
next(self)
Get the next item from the file iterator.
Method Details [hide private]

__init__(self, tarfile, tarinfo)
(Constructor)

 
Overrides: object.__init__
(inherited documentation)

readline(self, size=-1)

 

Read a line with approx. size. If size is negative, read a whole line. readline() and read() must not be mixed up (!).