Currently we cannot use `java.io.File`, right? We ...
# kotlin-native
c
Currently we cannot use
java.io.File
, right? We have to use functions such as fopen() to deal with files. Is it possible that in the future there is a
kotlin.io.File
so no porting is needed?
👍 1
l
AFAIK, there is a https://github.com/Kotlin/kotlinx-io project, which deals with io but not file system.
p
fwiw, I ran into this issue with a command line app that I want to work on the JVM, Native (Win/Lin/Mac) platforms. My solution (in-progress) is to build a TextFile abstraction using java.io.File on the JVM and the posix file operations for the Kotlin Native code. I’ll publish it on GitHub in a few days so stay tuned. 🙂
c
I hope @cy is taking inspiration from the fantastic Okio API, which AFAIK is also being worked on to make it compatible with K/N.
n
Not all platforms that Kotlin Native supports have access to a file system (eg embedded).
l
Okio doesn't work just for file system I/O, so it's not a problem