CFBReader

Overview

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

Reusable reader for Compound File Binary (CFB) containers.

Properties

NameTypeAccessDescription
data_sizeintReadIs the total size of all stream data in the CFB file
major_versionintReadIs the major version number from the CFB header
sector_sizeintReadIs the size in bytes of a standard sector
mini_sector_sizeintReadIs the size in bytes of a mini sector
fat_sector_countintReadIs the number of FAT sectors in the file
directory_entry_countintReadIs the total number of directory entries
materialized_stream_countintReadIs the count of streams whose data has been loaded
file_sizeintReadIs the total size in bytes of the CFB file on disk
HEADER_LAYOUTDict[str, Tuple[int, int]]ReadRepresents the definition of header field offsets and sizes
DIRECTORY_ENTRY_LAYOUTDict[str, Tuple[int, int]]ReadRepresents the definition of directory entry field offsets and sizes
header``ReadContains the parsed header bytes of the CFB file
difatList[SectorNumber]ReadIs the list of DIFAT sector numbers
fatList[int]ReadIs the list of FAT sector indices
mini_fatList[int]Read
directory_entries``ReadHolds all parsed DirectoryEntry objects
root_entry``ReadIs the DirectoryEntry representing the root storage
mini_stream``ReadIs the raw byte content of the mini stream
stream_dataDict[StreamId, bytes]ReadMaps StreamId to the loaded bytes of each stream

Methods

SignatureDescription
__init__(data: bytes | mmap.mmap, _mmap_owner: mmap.mmap | None)
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