← Docs
kotlin-stdlib / kotlin.io / FileTreeWalk / maxDepth

maxDepth

JVM
1.0
fun maxDepth ( depth : Int ) : FileTreeWalk
(source)

Sets the maximum depth of a directory tree to traverse. By default there is no limit.

The value must be positive and Int.MAX_VALUE is used to specify an unlimited depth.

With a value of 1, walker visits only the origin directory and all its immediate children, with a value of 2 also grandchildren, etc.

Stay in touch:
  • Contributing to Kotlin
  • Releases
  • Press Kit
  • Security
  • Blog
  • Issue Tracker
  • Brand assets
  • Careers
Supported and developed by JetBrains .
Kotlin™ is protected under the Kotlin Foundation
and licensed under the Apache 2 license .