Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a way to compress files within the app with current tools? #391

Open
karliwalti opened this issue Nov 17, 2020 · 1 comment
Open

Comments

@karliwalti
Copy link
Contributor

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?

@mgorges
Copy link
Contributor

mgorges commented Nov 17, 2020

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants