Add archive helpers and harden task runtime
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
:sig
|
||||
bool zip_extract(String zip_file_name, String destination_directory)
|
||||
|
||||
:params
|
||||
zip_file_name : path to the ZIP archive
|
||||
destination_directory : directory that should receive extracted files
|
||||
return value : `true` when extraction completes
|
||||
|
||||
:see
|
||||
>sys
|
||||
zip_create
|
||||
zip_list
|
||||
zip_read
|
||||
|
||||
:content
|
||||
Extracts every member in a ZIP archive into `destination_directory`.
|
||||
|
||||
```uce
|
||||
zip_extract("/tmp/example.zip", "/tmp/example-extract");
|
||||
```
|
||||
|
||||
UCE creates the destination directory and any needed child directories when they do not already exist.
|
||||
|
||||
For safety, every member name is normalized and checked before extraction. Absolute paths, drive-qualified paths, empty names, and `..` path segments are rejected so archives cannot write outside the destination directory.
|
||||
Reference in New Issue
Block a user