Expand description
SkillLite FS: 中心化文件操作
模块:
- read_write: read_file, write_file, append_file, atomic_write
- dir: read_dir, list_directory, file_exists, create_dir_all, copy, rename, remove_file, modified_time
- grep: grep_directory
- search_replace: apply_search_replace, apply_replace_fuzzy, insert_lines_at
- backup: backup_file, prune_oldest_files
- util: is_likely_binary, matches_glob
Structs§
- Fuzzy
Replace Result - 模糊匹配结果
Enums§
- Path
Kind - 路径类型
Constants§
- SKIP_
DIRS - 默认跳过的目录
Functions§
- append_
file - 追加写入文件
- apply_
replace_ fuzzy - 精确或模糊替换(单次替换时启用 fuzzy fallback)
- apply_
replace_ normalize_ whitespace - normalize_whitespace 模式:忽略行尾空白
- apply_
search_ replace - 纯内存:精确 search_replace
- atomic_
write - 原子写入:先写 .tmp 再 rename
- backup_
file - 备份文件到 backup_dir,返回备份路径
- build_
failure_ hint - copy
- 复制文件
- create_
dir_ all - 确保目录存在
- file_
exists - 检查路径是否存在及类型
- grep_
directory - 递归 grep 目录,返回匹配行
- insert_
lines_ at - 在指定行后插入内容,支持 auto-indent
- is_
likely_ binary - 检测文件是否可能为二进制(前 512 字节含 null)
- line_
byte_ offsets - 行首字节偏移
- list_
directory - 列出目录内容,返回排序后的条目
- matches_
glob - 简单 glob 匹配:支持 *.ext 或精确文件名
- modified_
time - 获取修改时间
- prune_
oldest_ files - 清理目录中最老的条目,保留 keep 个
- read_
bytes - 读取文件为原始字节
- read_
bytes_ limit - 读取文件前
limit字节(用于二进制检测等) - read_
dir - 读取目录条目,返回 (完整路径, 是否目录),已排序
- read_
file - 读取文件为 UTF-8 字符串
- remove_
file - 删除文件
- rename
- 重命名/移动
- safe_
excerpt - 安全截取片段(避免在字符中间切断)
- search_
replace_ file - 在文件内做精确 search_replace,返回替换次数
- write_
file - 写入文件(覆盖),UTF-8
Type Aliases§
- Grep
Match - 单条匹配:(相对路径, 行号, 行内容)