


























目前提供了python,node,rust 等内部访问基于9p协议
import zerofs_client
async with await zerofs_client.Client.connect("unix:/run/zerofs/9p.sock") as fs:
await fs.create_dir_all("/demo", 0o755)
await fs.write("/demo/notes.txt", b"hello from zerofs")
data = await fs.read("/demo/notes.txt")
meta = await fs.metadata("/demo/notes.txt")
print(len(data), meta.size, meta.is_file())
# A File handle for positioned I/O.
async with await fs.open("/demo/data.bin", zerofs_client.OpenOptions(write=True, create=True)) as f:
await f.write_at(0, b"\x00" * 4096)
await f.sync_all()
# Stream the directory entry by entry.
async with await fs.open_dir("/demo") as d:
async for entry in d:
print(entry.name)
await fs.rename("/demo/notes.txt", "/demo/notes.md")
await fs.remove_file("/demo/notes.md")
await fs.remove_dir_all("/demo")
如果能兼容fsspec 协议就更加强大了,可以实现高性能的数据处理(比如ai,数据分析。。。)
https://github.com/Barre/ZeroFS/tree/main/zerofs/zerofs-client
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。