Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update multiplatform example docs for file system #1400

Open
tethridge opened this issue Dec 20, 2023 · 1 comment
Open

Update multiplatform example docs for file system #1400

tethridge opened this issue Dec 20, 2023 · 1 comment

Comments

@tethridge
Copy link

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

@ajalt
Copy link
Contributor

ajalt commented Jan 17, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants