From 31d413eff6066c8d93e77a85338cbc0413a45174 Mon Sep 17 00:00:00 2001 From: Nathan Boyer <65452054+nathanrboyer@users.noreply.github.com> Date: Tue, 20 Aug 2024 13:31:31 -0400 Subject: [PATCH] Explain `walkdir` docstring second example. (#55541) This is a follow-up documentation PR to #55476. I believe the second example in the `walkdir` docstring is still unintuitive since the result changes each time. I attempted a simple explanation, but I don't really know what I'm talking about. Hopefully someone else can explain what is happening better. Some additional discussion in [this Discourse post](https://discourse.julialang.org/t/find-all-files-named-findthis-csv-in-nested-subfolders-of-rootfolder/118096). --------- Co-authored-by: Lilith Orion Hafner --- base/file.jl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/base/file.jl b/base/file.jl index 7fa4a288c1d10..81bca9dd65577 100644 --- a/base/file.jl +++ b/base/file.jl @@ -1102,6 +1102,8 @@ The directory tree can be traversed top-down or bottom-up. If `walkdir` or `stat` encounters a `IOError` it will rethrow the error by default. A custom error handling function can be provided through `onerror` keyword argument. `onerror` is called with a `IOError` as argument. +The returned iterator is stateful so when accessed repeatedly each access will +resume where the last left off, like [`Iterators.Stateful`](@ref). See also: [`readdir`](@ref).