文件系统¶
- class litestar.file_system.BaseLocalFileSystem¶
基类:
FileSystemProtocol本地文件系统的基类。
- async open(file: PathType, mode: str, buffering: int = -1) AsyncFile[AnyStr]¶
Return a file-like object from the filesystem.
备注
The return value must be a context-manager
- __init__()¶
- class litestar.file_system.FileSystemAdapter¶
基类:
objectWrapper around a
FileSystemProtocol, normalising its interface.- __init__(file_system: FileSystemProtocol) None¶
Initialize an adapter from a given
file_system- 参数:
file_system¶ -- A filesystem class adhering to the
FileSystemProtocol
- async info(path: PathType) FileInfo¶
Proxies the call to the underlying FS Spec's
infomethod, ensuring it's done in an async fashion and with strong typing.- 参数:
path¶ -- A file path to load the info for.
- 返回:
A dictionary of file info.