lambdanative
lambdanative copied to clipboard
Is there a way to compress files within the app with current tools?
I am looking for a way to compress folders and files therein during app execution (i.e. to upload a single file or create a backup) .
The zip module seems to only support reading zip files.
There are also the file-compress and packtool but also those seem to only support decompression.
https://github.com/part-cw/lambdanative/blob/4fa37ef4392cc218a86b7dee7813f87797a20320/modules/ln_core/file-compress.scm https://github.com/part-cw/lambdanative/blob/4fa37ef4392cc218a86b7dee7813f87797a20320/modules/ln_core/packtool.scm
the packtool writing function seems to be in the app folder, but rather specialized for the deployment of the app packages? https://github.com/part-cw/lambdanative/blob/4fa37ef4392cc218a86b7dee7813f87797a20320/apps/packtool/main.scm
Do I miss something?
We have (compress-file src dst) as you found, which should do compression, not only (decompress-file src dst) - see Wiki: compress-file. The former is also available simplified as (quick-compress src).
As for zipping, Wiki: Module: zip states that 'Only reading is implemented at the moment' so those bindings would have to be added to modules/zip/zip.scm? Would zip_file_add be enough, or which ones from https://libzip.org/documentation/ would you need?