0PricingLogin
Kotlin Multiplatform Academy · Lesson

File System & Paths per Platform

Read and write files portably across targets.

Files Live in Different Places

Android and iOS store app files in totally different folders. Shared code needs a portable way to find a safe place to write. 📁

Declare a Paths expect

Put a small expect function in commonMain that returns the app's data directory as a plain String path.

expect fun dataDir(): String

All lessons in this course

  1. Design a Capability Interface
  2. expect/actual for Device Info
  3. File System & Paths per Platform
  4. Inject Platform Implementations
← Back to Kotlin Multiplatform Academy