What does that even mean? How are the file and the...
# getting-started
k
What does that even mean? How are the file and the String related?
e
Copy code
val ktx = "orange_la8_unorm.ktx"
            gli.save(texture, ktx)
            val textureLA8unormKTX = gli.load(ktx)
            Files.delete(pathOf(ktx))
I'd like to write directly
Files.delete(ktx)
retrieve the
Path
from that
String
and delete
k
e
I know, but it doesnt here, mind trying one moment on your pc?
fun Files.Companion.delete(str: String): Unit = delete(pathOf(str))
fun pathOf(uri: URI): Path = Paths.get(uri)
k
I think I found the problem:
If a class has a companion object defined, you can also define extension functions and properties for the companion object:
Files
doesn't have a companion object.
e
ah, shit
thanks Karel
👍 1