Closed flokli closed 1 year ago
Well, can you show the failure? If it's failing at entry.unwrap()
then that seems... right to me?
That's the failing error output:
---- tests::recursive::sym_nonenexisting_target_root stdout ----
thread 'tests::recursive::sym_nonenexisting_target_root' panicked at 'called `Result::unwrap()` on an `Err` value: Error { depth: 0, inner: Io { path: Some("/tmp/rust-walkdir/39/root"), err: Os { code: 2, kind: NotFound, message: "No such file or directory" } } }', src/tests/recursive.rs:379:28
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
The problem is that it seems to try to stat the symlink target, not the symlink itself?
Looks correct to me. From the docs:
If root is a symlink, then it is always followed for the purposes of directory traversal. (A root DirEntry still obeys its documentation with respect to symlinks and the follow_links setting.)
Ah yes nice, #170 should solve this. Thanks for linking to it!
If the root path we point
WalkDir::new
to is a symlink pointing to a non-existent target,WalkDir
fails to unwrap that entry.See the two tests for reference
The latter currently fails.