I see this question got not answers :disappointed:...
# getting-started
m
I see this question got not answers 😞 Is it now possible after 1.5 year?
j
There are nice extensions on
File
and
Path
now which may help with that
For instance, there is
path.listDirectoryEntries(glob)
if you don't need to go recursive
m
Yeees, but it's about recursive glob, and for that I have not found anything
j
Then I think you might need to use
FileTreeWalk
m
I'd like to just write
glob("a/*/b/*.c")
though 😞
j
You can write an extension using the snippet mentioned in the question you linked if you want to use it this way. I don't think there is more in the stdlib right now, but I don't have extensive knowledge of this area tbh
m
I can, except as mentioned in OP it is very inefficient for big file trees. I'm fine it to be outside of stdlib, but I can't find any library either.
j
If you believe it's faster, you could also call a separate process to do an actual glob, but then you're platform dependent
Did you actually measure that the performance of this snippet doesn't suit your needs? Given that it gives a sequence of files, you could process them in parallel of the walk
m
The point is this snippet walks through every file under the given root and then compares the whole path, while the proper glob implementation would skip irrelevant subpaths based on the given pattern.
e
I think it's a bit beyond the scope of a kotlin-stdlib that doesn't even have cross-platform IO to begin with, unfortunately