I am not entirely sure how to use `File.walk` some...
# announcements
c
I am not entirely sure how to use
File.walk
someone got a handy example
d
chb0kotlin: Like any other sequence, you can just iterate over it with
for (file in folder.walk())
r
Or more functionally something like this:
Copy code
val files = File(...).walkTopDown()
    .filter { it.isFile }
    .filter { match.matches(it.name) }
    .map(File::toPath)
👍 1
c
Ah, ok. I was looking for a functional application. .... Yeah, just like that 🙂
r
There is
walk
,
walkTopDown
and
walkBottomUp
also, in case order matters.
All extension functions in stdlib