Module PIL.ContainerIO

Module Summary:

class ContainerIO:
    def __init__(self, file, offset, length)
A file object that provides read access to a part of an existing file (for example a TAR file).

Classes

The ContainerIO Class

ContainerIO()

A file object that provides read access to a part of an existing file (for example a TAR file).

Constructor:

ContainerIO(file, offset, length)

Create file object.

Parameters:

file -- Existing file.

offset -- Start of region, in bytes.

length -- Size of region, in bytes.

Method Summary:

isatty()
Always false.
read(bytes=0)
Read data.
readline()
Read a line of text.
readlines()
Read multiple lines of text.
seek(offset, mode=0)
Move file pointer.
tell()
Get current file pointer.

isatty

isatty()

Always false.

read

read(bytes=0)

Read data.

Parameters:

bytes -- Number of bytes to read. If omitted or zero, read until end of region.

Returns:

An 8-bit string.

readline

readline()

Read a line of text.

Returns:

An 8-bit string.

readlines

readlines()

Read multiple lines of text.

Returns:

A list of 8-bit strings.

seek

seek(offset, mode=0)

Move file pointer.

Parameters:

offset -- Offset in bytes.

mode -- Starting position. Use 0 for beginning of region, 1 for current offset, and 2 for end of region. You cannot move the pointer outside the defined region.

tell

tell()

Get current file pointer.

Returns:

Offset from start of region, in bytes.