Add portable directory enumeration to std::fs
- Dominant language
- Rust
- Stars
- 53
- Forks
- 16
- Avg merge
- 4h 22m
- Merged PRs (30d)
- 46
Description
## Summary
The portable filesystem API supports file access, metadata, path mutation, and current-directory operations, but it cannot enumerate directory entries.
## Relevant code
- `std/fs/file.wave`
- platform providers under `std/sys/*/fs.wave`
## Scope
Add a portable, allocation-conscious directory iterator or caller-buffer API. Keep native directory record layouts and Windows search handles behind `std::sys::fs`.
## Acceptance criteria
- Callers can open a directory, iterate entries, distinguish end-of-directory from failure, and close resources.
- Entry names are copied into caller-owned storage with explicit capacity handling.
- `.` and `..` behavior is specified consistently.
- Linux and macOS implementations include native tests.
- Windows uses native directory enumeration and closes search handles reliably.
- FreeBSD support is implemented or explicitly gated until its runtime target is available.
- A small `examples/std` program demonstrates listing a directory.
Contributor guide
Research direction
Start with std/fs/file.wave and compare the platform providers under std/sys/*/fs.wave to understand the existing filesystem API and native boundaries. Run the existing filesystem tests, then use the acceptance criteria to verify Linux and macOS native tests, Windows handle cleanup, FreeBSD gating or support, and the examples/std directory-listing example.
Written by the indexing model from the issue text.
Assessment
- Domain
- operating-systems
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100