Commit activity
Last 12 weeks · 0 commits
Community health
2 of 6 standards met
Recent PRs & issues
The documented helper treats and as hidden entries, so prunes the entire walk. Use in the README and all five API examples; special dot paths have no file name and remain eligible for traversal. Fixes #154. Validation: executed the README helper against both root paths (0 entries before, 1 after with ), (47 tests and 20 doctests), , and . This documentation change was prepared with Codex assistance.
Problem The branch added the platform-specific directory readers, but never finished hooking them into recursive traversal. Child directories were still opened from their full path, which is where the long-path and TOCTOU problems come from. Solution I've finished the walker so that it keeps each active parent directory open and opens its children relative to it. On Unix, this uses , and on Windows this uses . Directory entries are read with or on supported Unix targets, and with on Windows. On other Unix targets, we fall back to . Note that sorting and can discard the parent handle, so those cases still fall back to opening the full path. The changes I've added are split into seven commits. First, I restored the path-based walker and added . Unix enumeration and relative opens come next as separate commits, followed by the equivalent Windows changes. The last commit just reuses the parent path buffer. I also dropped and its allocation benchmark. They aren't needed for this change, but if you'd like them back please let me know and I'd be happy to restore that. Notes There are a couple of changes worth pointing out. One is that now returns , since the platform readers cannot construct . Secondly, on Windows now stats the entry when called instead of returning metadata saved during enumeration. Last, but not least, the MSRV is now Rust 1.71 because of , which is used because does not expose the APIs used here. LLM use I used Codex (namely 5.5/5.6 sol) for the seven commits after that. They helped mostly with code exploration and the implementation, though reviewing & testing the code was done by me. Testing I've tested this on Linux, Windows on both gnu and msvc, FreeBSD, OpenBSD, NetBSD, DragonFly, Solaris and macOS. (Thank you to cfarm :) ) (cc @Ericson2314)
Repository: BurntSushi/walkdir. Description: Rust library for walking directories recursively. Stars: 1558, Forks: 132. Primary language: Rust. Languages: Rust (99.3%), C (0.5%), Python (0.2%). License: Unlicense. Open PRs: 31, open issues: 26. Last activity: 4mo ago. Community health: 42%. Top contributors: BurntSushi, budziq, jeremielate, opilar, yufengwng, AndyGauge, GuillaumeGomez, igor-raits, tmccombs, nivkner and others.