square / okio

A modern I/O library for Android, Java, and Kotlin Multiplatform.

Home Page:https://square.github.io/okio/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Update multiplatform example docs for file system

tethridge opened this issue · comments

Please update the multiplatform docs to explain that you have to use expect/actual to get an instance of the file system. I assumed I was missing something since all of the docs indicate that I should be able to reference FileSystem.SYSTEM.

https://square.github.io/okio/multiplatform/

I'm not alone, because there is another ticket that asked the same question. See: #1070

I also ran into this. It turns out that, as mentioned in #1070 (comment), the commonizer is able to make SYSTEM available as long as you don't have a JS source set. IntelliJ might not recognize the reference, but if you actually compile your code it should work.

As a workaround, I ended up using fun filesystem(): FileSystem = FileSystem.SYSTEM instead of SYSTEM directly so that autocomplete works.