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 and return at most n bytes.


Read all data from the chunk.


Same as RawIOBase.readinto().

seek(offset, whence=0)[source]

Move to a new chunk position.


Current file position.