BurntSushi / walkdir

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

Support starting from an `openat` root #136

Closed Ekleog closed 4 years ago

Ekleog commented 4 years ago

Hello,

I'm writing a long-lived SMTP server daemon (https://github.com/Ekleog/yuubind if you're interested, most information is in the mdbook).

As such, I start the daemon with openat on the queue directory. And then, I do all of the handling relative to this openat, so as to avoid any mounting changes disrupting the operation.

However, walkdir works only by taking in a full Path. Do you think it'd make sense to provide an API that takes in an openat::Dir (from the openat crate) -- or just a RawFd -- and walks the directory starting from this openat?

I see that https://github.com/BurntSushi/walkdir/issues/23 mentions openat (though more as a bugfix than as an additional feature), so I guess this would probably be blocked on #23 being solved so that the basic infrastructure of openat be present.

How would you feel about such a change?

BurntSushi commented 4 years ago

Yes, I consider this a dupe of #23. The API isn't too much of a concern. Building the infrastructure to support it is. I still haven't made up my mind on whether I will continue down that path. See #120 for more details.