compare catalog and compressed catalog (is there new changes) - linux

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.

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.

zipx with xz compression(95)

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.

Getting files names inside a rar/zip file without unzip

Does anyone know if it is possible to get the name of files inside a rar/zip without having to unrar/unzip the file.. and if yes, is there a way to block it or make difficult..
Thanks
The file names in a zip file are visible even if the data is encrypted. If you want to hide the names, the easy solution is to zip the zip file encrypted.
Later versions of PKZip do have an option to encrypt the file names as well with –cd=encrypt. (cd means central directory.)
The -l flag to unzip(1) does just that:
-l
list archive files (short format). The names, uncompressed file sizes and modification dates and times of the specified files are printed, along with totals for all files specified.
unrar(1) has the l option:
l
List archive content.

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.

Resources