zipx with xz compression(95) - zip

When using zipx with xz, zip format will be same, only compression method changes to 5F, right?
But my doubt is, when i want to compress a folder with multiple file, how does zip do it using xz? Because, xz only supports to compress one single file..
So winzip might have to do some operation to make the folder and its contents to a single file (operation like tar or cpio)
So what METHOD does it use to archieve all the files into a single one?
We tried to zip the folder with no compression to make it to one file, and apply xz on that, but we need to unzip twice to get the orginal folder.
How does zipx do it in one unzip?

The zip file format compresses each file individually. So it can use xz for that, no problem, which compresses one file. The zip format is individual file compression followed by archiving. Things like .tar.gz or .tar.xz are the opposite, which is archiving followed by compression of the entire archive.

Related

Compare files to files inside a Zip archive

I have a zip file which I extract to a folder. I then need to open the files and perform various functions but the files are not modified or saved at all.
I use Dotnetzip to extract the files from the archive before the files are opened and viewed etc.
Is there a way to compare the files, which was extracted, to the files still inside the zip file without extracting those files again? The zip files I have is quite large. Some of them several 100 Mb's so don't want to wait for another extraction process again.
Thanks!

File size not reducing after compressing

In my laptop, whenever i try to compress any file (doc, docx, pdf, jpg, etc etc) using 7zip or any other software, the size of compressed file remains the same as original file. I set the correct setting but still it's same.
Some say that the file can't be compressed anymore and try to compress other file but i tested all my files in my laptop and none of those files are getting reduced in size after compression.
Not sure about .doc, but .docx, .pdf. and .jpg are all already compressed. Something that's already compressed looks like random bits to a compressor, and so can't be compressed. In fact, they will be expanded very slightly. The only way to compress those is to first decompress them, and then recompress them with something that's more effective. Assuming that you can find something that's more effective.

compare catalog and compressed catalog (is there new changes)

I want to compare catalog with compressed without extracting or compress files and compare. Is there any way to compare directory with compressed directory ?
Example:
I have some files in tmpfs (ramdisk), before server shutdown, I need to save files to disk. In my opinion best way is compress files and save to disk like a file. On start server (system) I want to decompress files in to the ramdisk. But after couple days ramdisk files will be updated (different with compress file backup).
How to compare and merge diff ?
Regards,
Nerus.
Executing:
tar -tvf foo.tar.gz
will show the contents of the compressed file without decompressing. You can then compare the files.

Serving zip files as directories in Apache httpd

Is it possible to configure Apache httpd to treat zip files as if they were directories. I would like to be able to serve a directory tree both as a zip-file and as a directory, but I would like to avoid having to keep both on disk. If possible, I'd like to just have the zip files on disk and let Apache serve them as regular directories, but the otherway around would work too.
Probably not, because zip is sequence structured, means if somebody access the last file in the zip file, the whole zip need to be read to extract the last file.

How to change a file inside an archive (.ear) file without extracting entire file

I have an .ear file (an archive file like tar / zip) that has a file inside that i want to change.
For example myfile.ear contains 1.txt and i want to change 1.txt to 2.txt and possibly also change some of the content inside 1.txt (like sed does)
I really want to avoid having to extract myfile.ear, change the file and compress it again.
Does anyone know a way to achieve this in linux ?
And if it's not possible, I would also like to know why
Thanks.
EAR files are just JAR files which are just ZIP files. The ZIP format, IIRC, contains metadata and data interleaved, so changing one file (which might be larger/smaller than the file it is replacing) might not fit (or leave a gap), thus in all practical terms the file must be rewritten when doing modifications.

Resources