parentFile

@get:JvmName(name = "parentFileOf")
val File.parentFile: File?(source)

The path parent. If no parent is available, null is returned.

e.g.

assertEquals("hello".toFile(), "hello/world".toFile().parentFile)
assertNull("world".toFile().parentFile)