CFBReader

Overview

CFBReader is a class in Aspose.Email FOSS for Python.

Reusable reader for Compound File Binary (CFB) containers.

This class provides 11 methods for working with CFBReader objects in Python programs. Available methods include: __init__, close, find_child_by_name, from_file, get_entry, get_stream_data, iter_children, iter_storages, iter_streams, iter_tree, resolve_path. All public members are accessible to any Python application after installing the Aspose.Email FOSS for Python package. Properties: DIRECTORY_ENTRY_LAYOUT, HEADER_LAYOUT, data_size, difat, directory_entries, directory_entry_count, and 12 more.

Properties

NameTypeAccessDescription
data_sizeintReadGets the data size.
major_versionintReadGets the major version.
sector_sizeintReadGets the sector size.
mini_sector_sizeintReadGets the mini sector size.
fat_sector_countintReadGets the fat sector count.
directory_entry_countintReadGets the directory entry count.
materialized_stream_countintReadGets the materialized stream count.
file_sizeintReadGets the file size.
HEADER_LAYOUTDict[str, Tuple[int, int]]ReadGets the header layout.
DIRECTORY_ENTRY_LAYOUTDict[str, Tuple[int, int]]ReadGets the directory entry layout.
header``ReadGets the header.
difatList[SectorNumber]ReadGets the difat.
fatList[int]ReadGets the fat.
mini_fatList[int]ReadGets the mini fat.
directory_entries``ReadGets the directory entries.
root_entry``ReadGets the root entry.
mini_stream``ReadGets the mini stream.
stream_dataDict[StreamId, bytes]ReadGets the stream data.

Methods

SignatureDescription
__init__(data: bytes | mmap.mmap, _mmap_owner: mmap.mmap | None)Calls init on this CFBReader instance.
from_file(path: Path | str)"CFBReader"Loads a CFB file from the given path and returns a CFBReader instance
close()Releases any resources associated with the opened CFB file
get_entry(stream_id: StreamId)DirectoryEntryReturns the DirectoryEntry for the specified stream identifier
get_stream_data(stream_id: StreamId)bytesReturns raw bytes of the stream identified by stream_id
iter_storages()Iterator[DirectoryEntry]Yields DirectoryEntry objects representing storage entries
iter_streams()Iterator[DirectoryEntry]Yields DirectoryEntry objects representing stream entries
iter_children(storage_stream_id: StreamId)Iterator[DirectoryEntry]Yields child DirectoryEntry objects of the given storage
iter_tree(start_stream_id: StreamId)Iterator[Tuple[int, DirectoryEntry]]Yield a depth-first tree traversal as (depth, entry) tuples.
find_child_by_name(storage_stream_id: StreamId, name: str)Optional[DirectoryEntry]Searches for a child entry with the given name under a storage
resolve_path(names: Iterable[str], start_stream_id: StreamId)Optional[DirectoryEntry]Resolve a storage/stream path by exact directory-entry names.

See Also