2023-04-17 12:09 AM
I am writing a program to unzip a zip file downloaded from cloud in memory by itself if it seem any zip file available in memory but I am not getting any small & simple library to implement it.
Can anyone help me regarding this?
2023-04-17 12:36 AM
Depends on how you define small and simple, and which compression methods are in use.
One can find helpers to do tedious work for them.
2023-04-17 12:52 AM
Actually I have seen libzip library but it was very complex i.e. I am asking about easy library which will easy to understand.
2023-04-17 12:34 PM
If you have not found a "easy" library after sufficient googling, maybe it does not exist?
Can you consider other (simpler) compressed format, for example this?
Or delegate this chore to somebody else and just use the result.
2023-04-17 12:51 PM
Seem to recall Mark Adler publishing a code example of Inflate in the early 1990's. Phil Katz also documented his algorithms, and I've written code based on those.
https://github.com/madler/zlib/blob/master/inflate.c
Most of this stuff ends up being non-trivial, and things which are simple (to use) tend to involve a lot of actual work. A lot of code either expects to be working with a file-system, or infinite supplies of RAM, things which MCU embedded tends not to have.
2023-04-17 01:12 PM
These libraries usually have embedded-friendly decompression mode that streams the data to RAM buffers, without any dependency on files. For example, the EmWin PNG add-on includes this stuff to decompress PNG images.
But the zip format actually is a container that can hold items compressed in different ways (or not compressed at all). Locating items in the zip is a bonus task )) Also, zipped items can be encrypted - yet another bonus.