AS AgentScopeAPI 手册 / API Reference
类class agentscope.tool

DirEntry

@dataclass
class DirEntry
源码Source agentscope/tool/_builtin/_backend.py:87–108

目录条目,让智能体以受控方式调用外部能力。位于 agentscope.tool 包。

Mirrors :class:os.DirEntry: the metadata comes from the same directory read as the name, so a listing costs one round trip instead of one per entry plus one per attribute.

属性摘要Attribute Summary

属性Attribute类型Type说明Description值Value
namestr
名称字段。
The entry's base name, without any leading directory.
—
is_dirbool
是目录字段。
Whether the entry is a directory, following symlinks.
—
size_bytesint | None
大小字节字段。
Size in bytes of a file. Always ``None`` for a directory — its on-disk size says nothing a caller wants — and ``None`` when it could not be determined (a broken symlink, a vanished entry).
None
mtimefloat | None
`mtime` 字段。
Modification time as a POSIX timestamp, or ``None`` for the same reasons.
None

属性详情Attribute Detail

name

str

名称字段。声明为 str。

The entry's base name, without any leading directory.

源码Source agentscope/tool/_builtin/_backend.py:105

is_dir

bool

是目录字段。声明为 bool。

Whether the entry is a directory, following symlinks.

源码Source agentscope/tool/_builtin/_backend.py:106

size_bytes

int | None = None

大小字节字段。声明为 int | None。

Size in bytes of a file. Always None for a directory — its on-disk size says nothing a caller wants — and None when it could not be determined (a broken symlink, a vanished entry).

源码Source agentscope/tool/_builtin/_backend.py:107

mtime

float | None = None

mtime 字段。声明为 float | None。

Modification time as a POSIX timestamp, or None for the same reasons.

源码Source agentscope/tool/_builtin/_backend.py:108
基于官方固定版本源码静态生成Generated from pinned official sources · Python 2.0.11 · Java 2.0.4
签名与文档为静态抽取;如有疑问请以源码为准。Signatures and docs are extracted statically; verify against the source when in doubt.