What is the best way for working with files in kot...
# announcements
h
What is the best way for working with files in kotlin? Do I still need to use FileInputStream and other classes from Java?
k
Yes.
p
Yes, but you can use standard extension functions that make this easier. https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.io/index.html#extensions-for-external-classes
p
I also wrap functions that work on files in a suspend fun
n
for simple things like readText, writeText, useLines, mkdirs, etc (which is really all i needed to use so far) you do not need to fall back to java i hope those will soon be available in a multiplatform library
h
Thanx guys
🆗 1
r
I also wrap functions that work on files in a suspend fun
Theoretically these should run in an IO dispatcher...