forEachDirectoryEntry

inline fun Path.forEachDirectoryEntry(glob: String = "*", action: (Path) -> Unit)(source)

Performs the given action on each entry in this directory optionally filtered by matching against the specified glob pattern.

Since Kotlin

1.5

Parameters

glob

the globbing pattern. The syntax is specified by the FileSystem.getPathMatcher method.

See also

Throws

if the glob pattern is invalid.

If this path does not refer to a directory.

If an I/O error occurs.