跳转至

数据模型类

AListFile

AList文件(兼容异步文件对象)

属性:

名称 类型 描述
path str

文件路径

name str

文件名

size int

文件大小

provider int

存储类型

modified str

修改时间

created str

创建时间

url str

文件下载URL

sign str

签名

raw dict

原始返回信息

closed property

检查文件是否已关闭

mode property

获取文件打开模式

size property

获取当前文件大小(动态计算)

close() async

关闭文件并释放资源

download(chunk_size=1024 * 1024) async

流式下载文件到临时文件

fileno()

获取文件描述符(同步方法)

flush() async

强制刷写缓冲区到磁盘

iter_chunks(chunk_size=8192) async

异步迭代文件内容

read(n=-1) async

读取指定字节数

readline() async

读取单行(直到换行符)

readlines() async

读取所有行

save(path, chunk_size=1024 * 1024) async

异步保存文件到本地

seek(offset, whence=0) async

移动文件指针 :param offset: 偏移量 :param whence: 0=文件头, 1=当前位置, 2=文件尾 :return: 新的绝对位置

tell() async

获取当前文件指针位置

to_sync()

转换为同步文件对象

truncate(size=None) async

截断/扩展文件到指定大小

AListFolder

AList文件夹

属性:

名称 类型 描述
path str

文件路径

size int

文件大小

provider int

存储类型

modified str

修改时间

created str

创建时间

raw dict

原始返回信息

__init__(path, init)

初始化

参数:

名称 类型 描述 默认
path str

文件夹路径

必需
init dict

初始化字典

必需