Is there a KMP library for reading zip file. Can w...
# klibs-io
k
Is there a KMP library for reading zip file. Can we do it using kotlinx-io library ?
m
Reading and writing would be nice but I don’t know of any working solution. I have been searching for that too for a while.
k
I'm wondering if okio can be used.
m
Okio has support for it but not on all platforms. It only works on Java based platforms, so, e.g., it doesn’t work on iOS and web.
k
Ah interesting!
Learnt that we can use okio library for unpacking zip files. We can access
FileSystem.SYSTEM
from
iosMain
and
androidMain
but not
commonMain
. See this: • https://github.com/square/okio/discussions/1111#discussioncomment-3808110https://www.reddit.com/r/Kotlin/comments/ut2n62/comment/ltdx229/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button Worked like a charm
m
I’ll give it a try whether unpacking works but here’s my question whether we can also create one: https://github.com/square/okio/issues/1442#issuecomment-2233282968
😢 1
👍 1
j
Just published a lightweight library specifically for KMP ZIP handling: https://github.com/Jojo4GH/kzip Currently some targets are missing, but I am working on adding them. Also feel free to open PRs :)
👍 1
m
Any plans for JS/Wasm?
j
I will look into it, but am of course open to any contributions