okio icon indicating copy to clipboard operation
okio copied to clipboard

Update multiplatform example docs for file system

Open tethridge opened this issue 2 years ago • 1 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: https://github.com/square/okio/issues/1070

tethridge avatar Dec 20 '23 16:12 tethridge

I also ran into this. It turns out that, as mentioned in https://github.com/square/okio/issues/1070#issuecomment-975849936, 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.

ajalt avatar Jan 17 '24 21:01 ajalt