duplicity.filechunkio module

class duplicity.filechunkio.FileChunkIO(name, mode='r', closefd=True, offset=0, bytes=None, *args, **kwargs)[source]

Bases: FileIO

A class that allows you reading only a chunk of a file.

__init__(name, mode='r', closefd=True, offset=0, bytes=None, *args, **kwargs)[source]

Open a file chunk. The mode can only be ‘r’ for reading. Offset is the amount of bytes that the chunks starts after the real file’s first byte. Bytes defines the amount of bytes the chunk has, which you can set to None to include the last byte of the real file.

read(n=-1)[source]

Read and return at most n bytes.

readall()[source]

Read all data from the chunk.

readinto(b)[source]

Same as RawIOBase.readinto().

seek(offset, whence=0)[source]

Move to a new chunk position.

tell()[source]

Current file position.