Capy-Bearer Documentation

zip_extract

host call

Capy

function zip_extract(path : string, destination : string) bool

Description

zip_extract() extracts every entry from a ZIP archive.

Parameters

path : archive path

destination : destination directory

Return Values

true when the server extracts the archive.

Example

Capy

var archive := file_temp("/tmp/capy-zip-") + ".zip"
var destination := archive + ".out"
zip_create(archive, dval({"note.txt": "hello"}))
zip_extract(archive, destination)
print(file_get_contents(destination + "/note.txt"), "\n")
dir_remove(destination, true)
file_unlink(archive)