BurntSushi / walkdir

Rust library for walking directories recursively.
The Unlicense
1.21k stars 106 forks source link

Add option to yield empty directories #109

Closed alekratz closed 5 years ago

alekratz commented 5 years ago

Currently, with the structure:

test
├── a
├── b
├── d_a/
│   ├── c
│   └── d
└── d_b/

where d_a and d_b are directories, WalkDir will not yield d_b. It would be useful (to me, at least) to be able to optionally iterate over empty directories.

I may have a chance to look at implementing it in the future, if this is a desired feature.

BurntSushi commented 5 years ago

Please provide a minimal reproducible example that I can compile and run.

BurntSushi commented 5 years ago

Yeah I can't reproduce this. Closing due to inactivity.

[andrew@Cheetah walkdir-109] mkdir test
[andrew@Cheetah walkdir-109] mkdir -p test/{a,b,d_a,d_b}
[andrew@Cheetah walkdir-109] touch test/d_a/{c,d}
[andrew@Cheetah walkdir-109] /home/andrew/rust/walkdir/target/release/examples/wa
walkdir                   walkdir-ba2fdf8599bfcb83  walkdir-ffabb30439213554
[andrew@Cheetah walkdir-109] /home/andrew/rust/walkdir/target/release/examples/walkdir ./
./
./test
./test/d_b
./test/d_a
./test/d_a/d
./test/d_a/c
./test/b
./test/a