Serving zip files as directories in Apache httpd - zip

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.

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!

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.

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.

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.

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