On Circuitpython, how to decompress files from tar or gzip file? - adafruit-circuitpython

I can use utarfile.py to untar a file on Micropython.
But for circuitpython, even the latest 8.0.0 beta2.
There is no circuitpython version of utar, gzip library, or something like that.
If I use the uarfile.py, there is also no uctypes modules on circuitpython.
Could anybody tell me how to decompress a tar or gzip file on Circuitpython.
Thank you.

Related

Unzip specific files in a ARR file within a Tar.gz

i'am currently trying to unzip some specific files within a ARR file. This ARR file is within a tar.gz file.
Is it possible to unzip these files without a intermediate step/One liner. Its important that the first tar.gz will not be unpacked.
Thanks!
you can try something like:
gzip -dc input_file.tar.gz|tar xf - path/to/file/you/want/to/extract
This decompress and untar the archive in memory and have advantage of run faster.

Compress or copy folder to stdout

I can't compress folder recursively to stdout. Zip and 7-zip can one file to stdout, but not folder. Rar not compatible compress to stdout in principle. Tar, GZip, Bzip2 - obviously, etc. Please help me find to solution...

How to convert folder to jar in window

I want to convert folder to jar,
is there any command for cmd in window or good online converter to convert it?
Thanks in Advance.
a jar file is for a java program, if you need to compress a folder into a single file, try zip. You should be able to do it in windows.
https://support.microsoft.com/en-us/help/14200/windows-compress-uncompress-zip-files
You can install 7zip if you need a command line client.

Unzipping Multiple zip files using 7zip command line

I have a number of zip files located in a single folder eg:
file1.gz
file2.gz
file3.gz
file4.gz
I'm looking for a way of automatically unzipping these using a batch job to a similarly named folder structure so for example the contents of file1.gz will drop into a folder named file1.
I have been told that 7zip would address my issue but can't figure out how to go about it.
Any help is greatly appreciated.
Which OS are you using? This is something you'd do using the shell's capabilities, you could write
for A in *.gz ; do gunzip $A ; done
I'm using gunzip here, because .gz is actually gzip, But you can use the 7zip CLI tool as well, of course. If you're on Windows, then I recommend installing a real shell (the standard cmd.exe can not really be considered a shell IMHO).

nginx gzip_static won't create the gz file that doesn't exist automatically?

I'm just curious...
nginx will detect the gz files in the same dir,if it does not exists,it will use on-the-fly gzip and return a response(if gzip on)
so...when we turn gzip_static on,why nginx not to create a gz file with the output gzipped response?it's about trunked encoding or something else?
So do I really need to write a bash script to create/update the gz files everytime I modify the static files,right?
Thanks ^_^
You're right, as far as i can tell the two modules (gzip and gzip_static) don't really interact. Anything compressed on the fly by gzip will possibly be cached for a short period of time, but will not be saved for gzip_static. A bash script to automatically update the .gz files is a good idea, and if you're using source control, could be done as a post-command in Git or Hg.
It's worth noting that for small files the overhead is arguably in the disk access rather than the compression.. but every little bit helps.

Resources