Skip to content

[1053] (liii path) 增加 path-glob 与 path-rglob 文件通配与递归检索支持 - #1136

Merged
da-liii merged 4 commits into
mainfrom
da/1053/path_glob
Oct 17, 2026
Merged

da-liii merged 4 commits into
mainfrom
da/1053/path_glob

Conversation

@MoonL79

@MoonL79 MoonL79 commented Oct 16, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • 在 (liii path) 模块新增 path-glob(单层目录通配检索)与 path-rglob(全目录树递归检索)函数,对标 Python Path.glob() 与 Path.rglob()
  • 底层 C++ 利用 tbox tb_directory_walk 高效遍历并在回调中直接做通配模式过滤(支持 *、?、[abc]、[^abc]、[a-z] 及 Windows 大小写不敏感与多段尾部匹配),避免全量中间列表在 Scheme 堆中分配
  • 统一返回包含匹配项的 <path> 记录列表,元素支持既有 path 接口
  • 严格进行参数类型校验(type-error)、路径存在性校验(file-not-found-error)以及目录类型校验(not-a-directory-error)
  • 增加独立单元测试 tests/liii/path/path-glob-test.scm 与 tests/liii/path/path-rglob-test.scm,更新分类文档索引,通过全部 53 项 path 单元测试与端到端自动化测试

Fixes #1124

@da-liii
da-liii merged commit a43c697 into main Oct 17, 2026
5 checks passed
@da-liii
da-liii deleted the da/1053/path_glob branch October 17, 2026 04:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

(liii path): 增加 path-glob 与 path-rglob 文件通配与递归检索支持(对齐 Python Path.glob / Path.rglob)

2 participants