use Directory Entries
inline fun <T> Path.useDirectoryEntries(glob: String = "*", block: (Sequence<Path>) -> T): T
Content copied to clipboard
Calls the block callback with a sequence of all entries in this directory optionally filtered by matching against the specified glob pattern.
Return
the value returned by block.
Since Kotlin
1.5
See also
Parameters
glob
the globbing pattern. The syntax is specified by the FileSystem.getPathMatcher method.
Throws
if the glob pattern is invalid.
If this path does not refer to a directory.
If an I/O error occurs.