Downloaded File
- class b2sdk.v2.DownloadedFile(download_version, download_manager, range_, response, encryption, progress_listener, write_buffer_size=None, check_hash=True)[source]
Result of a successful download initialization. Holds information about file’s metadata and allows to perform the download.
- Parameters:
download_version (
DownloadVersion
) –download_manager (
DownloadManager
) –response (
Response
) –encryption (
Optional
[EncryptionSetting
]) –progress_listener (
AbstractProgressListener
) –
- class b2sdk.v2.MtimeUpdatedFile(path_, mod_time_millis, mode='wb+', buffering=None)[source]
Helper class that facilitates updating a files mod_time after closing.
Over the time this class has grown, and now it also adds better exception handling.
Usage:
- Parameters:
- write(value)[source]
This method is overwritten (monkey-patched) in __enter__ for performance reasons
- seekable()[source]
Return whether object supports random access.
If False, seek(), tell() and truncate() will raise OSError. This method may need to do a test seek().
- Return type:
- seek(offset, whence=0)[source]
Change the stream position to the given byte offset.
- offset
The stream position, relative to ‘whence’.
- whence
The relative position to seek from.
The offset is interpreted relative to the position indicated by whence. Values for whence are:
os.SEEK_SET or 0 – start of stream (the default); offset should be zero or positive
os.SEEK_CUR or 1 – current stream position; offset may be negative
os.SEEK_END or 2 – end of stream; offset is usually negative
Return the new absolute position.