Thread
#multiplatform
    jmfayard

    jmfayard

    1 year ago
    Is there a Kotlin Multiplatform library to work with files? a simple wrapper to
    java.util.File
    on the JVM and POSIX calls on Kotlin native
    fopen
    ,
    fclose
    ,
    acccess
    , ...
    e

    ephemient

    1 year ago
    https://github.com/Kotlin/kotlinx-io - largely not ready yet
    Javier

    Javier

    1 year ago
    okio
    apahl

    apahl

    1 year ago
    For basic File reading and writing on K/N, I use the functions described in this post:https://nequalsonelifestyle.com/2020/11/16/kotlin-native-file-io/
    Francis Mariano

    Francis Mariano

    1 year ago
    @apahl Do you use the functions on iOS too? How do you pass the filePath parameter?
    apahl

    apahl

    1 year ago
    No, I use K/N only on Linux.
    n

    napperley

    1 year ago
    Mobile platforms like Android, and iOS don't allow direct file access for security reasons (revolves around sand boxing).
    On Linux there is direct file access. This also applies to Flatpak ( https://flatpak.org/ ) although that is subject to sandbox restrictions and what file access permissions an app has in its manifest. Some Linux distributions like Linux Mint, and Fedora already support Flatpak, and provide the traditional app distribution method (deb, rpm etc).
    If Linux is being targeted, and a GTK based application is being developed then the GIO ( https://developer.gnome.org/gio/stable/ ) library might be an option (is an alternative the the POSIX File IO APIs).