-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Option to process parent before/after contents #18
Comments
This might be doable. I think it can be done without any change in memory requirements. It just requires a bit more state shuffling.
Why can't you use |
That would be useful e.g. for recursively deleting a directory.
Why can't you use std::fs::remove_dir_all
<https://doc.rust-lang.org/std/fs/fn.remove_dir_all.html>?
Because I'm trying to implement "find" in rust. Using walkdir would
eliminate an entire module of my code, but the -depth option requires the
parent to be processed after the contents.
thanks
Mark
|
I don't think I'll be doing this any time soon myself, but I'd be happy to review a PR. (My hope is that this is a small change, but if you think it's a large change, I'd like to discuss it in more detail first.) |
Done. See #19 |
I didn't see this issue or PR #19, but implemented something similar this morning by storing the My code visits each directory twice, once before and once after traversing the children: There are a bunch of clones that I should remove from my code (by making a common |
It's certainly conceptually simpler, but as you say still requires a bit of
polish. If you folks want to go this route instead then I'm not going to
storm off in a huff :-)
I'd advise copying the test stuff out of my pull request though: no point
re-implementing that...
Mark
…On Tue, Feb 7, 2017 at 4:52 AM, Michael Sproul ***@***.***> wrote:
I didn't see this issue or PR #19
<#19>, but implemented
something similar this morning by storing the DirEntrys for the
"deferred" directories inside the stack_list: DirList field.
My code visits each directory twice, once before and once after traversing
the children:
***@***.***
<michaelsproul@363c944>
There are a bunch of clones that I should remove from my code (by making a
common dir: DirEntry field on DirList), and it generally needs some
polish, but I figured I'd link it to see what you think.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#18 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ALbIF4WI75al5yy2aSctUQCP_UOq9Bzqks5rZ_iOgaJpZM4LyiuV>
.
|
Hi. Any progress on this? thanks Mark |
I haven't done anything on it... |
According to the docs:
Results are returned in depth first fashion, with directories yielded before their contents
Would it be possible to have an option to yield directories after their contents. That would be useful e.g. for recursively deleting a directory.
The text was updated successfully, but these errors were encountered: