Join Slack
is there any kotlin specific method to retrieve file with wildcard strings? Or I should just refer t...
# getting-started
e
elect
10/26/2021, 11:23 AM
is there any kotlin specific method to retrieve file with wildcard strings? Or I should just refer to the java
ones
?
j
Joffrey
10/26/2021, 12:07 PM
There are nice
Path
extensions that you can use with glob patterns. For instance:
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.io.path/java.nio.file.-path/list-directory-entries.html
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.io.path/java.nio.file.-path/for-each-directory-entry.html
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.io.path/java.nio.file.-path/use-directory-entries.html
(depending on what you want to do with it)
e
elect
10/26/2021, 12:19 PM
simple patterns such as
*.c
or
**
, thanks
elect
10/26/2021, 12:19 PM
only on
Path
😞 , poor
File
j
Joffrey
10/26/2021, 12:21 PM
Why would you need
File
though? For
File
you actually might have Java equivalents, or you can just
toPath()
😄
e
elect
10/26/2021, 12:21 PM
I start from that.. yeah I know
7
Views
Open in Slack
Previous
Next
kotlinlang
A modern programming language that makes developers happier.
Powered by