unzipFile

Last modified: 29 May 2025
val filesDir = _files.getFilesDir()
val src = _files.buildFile {
    setPath(filesDir, "tmp/abc.txt")
}
src.writeText("hello world", "UTF-8")
val dest = _files.buildFile {
    setPath(filesDir, "tmp/abc.zip")
}
_console.log(_files.zipFile(src, dest, null))
_console.log(dest.exists() && dest.isFile())
val unzipDir = _files.buildFile {
    setPath(filesDir, "tmp/abc")
}
_console.log(_files.unzipFile(dest, unzipDir, null))
_console.log(unzipDir.exists() && unzipDir.isDirectory())
src.delete()
dest.delete()
unzipDir.deleteRecursively()

tip