跳到主要内容

AFS

AFS 快速开始

在选择 provider、mount 或路径之前,先检查本机已安装的 AFS 命令面。

先确认你实际使用的运行时。命令与可用 provider 会随 ARC 版本变化。

bash
arc --version
arc afs --help

arc 2.0.0-beta.28 上实测:

text
2.0.0-beta.28
text
arc afs

AFS file system operations (ls, read, write, stat, exec, search, mount…)

Commands:
  arc afs ls [path]               List directory contents        [aliases: list]
  arc afs read <path>             Read file content               [aliases: cat]
  arc afs write <path> [content]  Write content to file
  arc afs delete <path>           Delete file or directory         [aliases: rm]
  arc afs stat <path>             Get file or directory info
  arc afs exec <executable_path>  Execute an action
  arc afs explain [topic]         Explain AFS concepts or paths
  arc afs search <path> <query>   Search for content within an AFS path
                                                           [aliases: grep, find]
  arc afs mount                   Mount management

以上命令只报告已安装版本与 AFS 命令面,不会替你创建 mount 或存储。

接下来做什么

  1. 优先做只读巡检:对实例上已经存在的路径使用 lsstatreadexplainsearch
  2. 不要对未知路径一上来就 writedeleteexec。路径只有在目标实例已有 provider 与 mount 配置后才有意义。
  3. 继续读 本地巡检,按实测步骤走完一次本地实例。
  4. 在应用代码依赖某操作之前,先读 核心合同

相关 CLI 手册

完整的 arc afs 参数参考在 arc-cli board。本 AFS board 讲路径、能力与 provider 合同,不复述每一条 CLI 旗标。

环境注意

  • arc afs 操作的是当前 CLI 会话可见的本地 AFS 面(通常是正在运行的 daemon)。你机器上的路径与 mount 不是通用默认值。
  • mount list 可能打印含凭证的 provider URI。把输出当敏感信息;分享或贴 issue 前先脱敏。
  • arc afs mount add 可能显示成功,但随后对该路径的 ls/read 仍失败。写入文档前先用 stat/ls 确认可用。见 Runtime boundaries