feat(stdlib): Mid2 M9 fs make_dirs, walk, and stat

Thicken lib/fs with recursive mkdir/rmdir-tree, metadata maps, and
depth-first walk; add gold tests and public demos.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
cflmyandCursor committed 2026-09-09 09:27:06 +08:00
1 parent 435f36b6e9
commit 955834e453
16 files changed
+311 -9

No files matched your search

+28
View File
@@ -35,11 +35,39 @@ description: English filesystem wrappers
**> host_make_dir path=`path`**
## make_dirs
+ `path`
Create directories recursively (`mkdir -p`).
**> host_make_dirs path=`path`**
## remove
+ `path`
**> host_remove path=`path`**
## remove_tree
+ `path`
Remove a directory recursively. Errors if `path` is a file.
**> host_remove_tree path=`path`**
## stat
+ `path`
Returns `{size, mtime_unix, is_file, is_dir}`.
**> host_stat path=`path`**
## walk
+ `path`
Depth-first listing of relative paths under `path` (forward slashes).
**> host_walk path=`path`**
## copy_file
+ `src`
+ `dest`
+28
View File
@@ -35,11 +35,39 @@ description: 中文文件系统包装
**> host_make_dir path=`路径`**
## 建目录树
+ `路径`
递归创建目录(等同 `mkdir -p`)。
**> host_make_dirs path=`路径`**
## 删除
+ `路径`
**> host_remove path=`路径`**
## 删目录树
+ `路径`
递归删除目录;若路径是文件则报错。
**> host_remove_tree path=`路径`**
## 状态
+ `路径`
返回 `{size, mtime_unix, is_file, is_dir}`。
**> host_stat path=`路径`**
## 遍历
+ `路径`
深度优先列出相对路径(正斜杠)。
**> host_walk path=`路径`**
## 复制文件
+ `源`
+ `目标`