DirectoryEntry

Overview

DirectoryEntry is the read-only object returned by CFBReader iterator methods such as iter_storages, iter_streams, and iter_tree. Each instance corresponds to one record in the CFB directory and exposes the metadata encoded in that record, including the node’s position in the red-black tree used for sibling ordering.

Key fields: stream_id, name: str, object_type: DirectoryObjectType, stream_size: int, clsid: bytes, creation_time: int, modified_time: int.

from aspose.email_foss.cfb import CFBReader

with CFBReader.from_file("archive.cfb") as reader:
    for entry in reader.iter_storages():
        print(f"storage: {entry.name} sid={entry.stream_id}")
    for entry in reader.iter_streams():
        data = reader.get_stream_data(entry.stream_id)
        print(f"stream: {entry.name}, size={entry.stream_size}")

Methods

MethodReturnsDescription
is_storage()boolReturns True if object_type is STORAGE_OBJECT.
is_stream()boolReturns True if object_type is STREAM_OBJECT.
is_root()boolReturns True if object_type is ROOT_STORAGE_OBJECT.

See Also