unzip

How do I recusively unzip nested ZIP files?

你离开我真会死。 提交于 2019-12-07 11:17:43
问题 Okay, given there is a secret file deep inside a nested ZIP file , i.e. a ZIP file inside a zip file inside a zip file, etc... The ZIP files are named 1.zip , 2.zip , 3.zip , etc... We don't know how deep the ZIP files are nested but it may be thousands . What would be the easiest way to loop through all of them up until the last one to read the secret file ? My initial approach would have been to call unzip recursively, but my bash skills are limited. What are your ideas to solve this? 回答1:

How do I flatten the top level folder of a zip file with ant?

匆匆过客 提交于 2019-12-07 09:41:12
问题 A lot of zip files have a root folder, how do I unpack the zip file and get rid of the root folder? I know there is the globmapper : <unzip dest="${dest.path}"> <fileset dir="${source.path}"> <include name="**/zipfile*.*.zip" /> </fileset> <mapper> <globmapper from="rootFolder/*" to="*" /> </mapper> </unzip> But what if I don't know the name of the root folder? Wildcards are not working e.g. <globmapper from="root*Folder/*" to="*" /> Is there a way to use wildcards or a mapper/function that

ZipInputStream doesn't report *actual* (i.e. compressed) bytes read

孤者浪人 提交于 2019-12-07 07:57:07
问题 Love this website! My issue is as follows: I'm reading a zip file that's coming over a network from an HTTP "PUT" request. The request header tells me that the Content-Length is (say) 1Mb. The following code creates the ZipInputStream, and saves the zip contents to files in the current directory: ZipInputStream zis = new ZipInputStream(inputStream); ZipEntry ze; long totalBytesRead = 0; while ((ze = zis.getNextEntry()) != null) { BufferedOutputStream outStream = new BufferedOutputStream(new

unzip specific extension only

喜夏-厌秋 提交于 2019-12-07 07:23:59
问题 I have a a directory with zip archives containing .jpg, .png, .gif images. I want to unzip each archive taking the images only and putting them in a folder with the name of the archive. So: files/archive1.zip files/archive2.zip files/archive3.zip files/archive4.zip Open archive1.zip - take sunflower.jpg, rose_sun.gif. Make a folder files/archive1/ and add the images to that folder, so files/archive1/folder1.jpg, files/archive1/rose_sun.gif. Do this to each archive. I really don't know how

C# Deleting a .ZIP file after unzipping

家住魔仙堡 提交于 2019-12-07 06:50:30
问题 I am using the Ionic.Zip.dll from the DotNetZip library and I'm trying to delete the ZIP file after it finishes unzipping, but I can't manage to do it. Here is the code I have currently: using (ZipFile zip = ZipFile.Read(nextVersion + ".zip")) { zip.ExtractAll(Directory.GetCurrentDirectory(), ExtractExistingFileAction.OverwriteSilently); try { File.Delete(nextVersion + ".zip"); } catch (Exception) { MessageBox.Show("Could not delete ZIP!"); Environment.Exit(1); } } What am I doing wrong here?

Uploading & Unzipping files to S3 through Rails hosted on Heroku?

谁说我不能喝 提交于 2019-12-07 05:23:56
问题 I'd like to be able to upload a zip file to my Rails application that contains a number of images. Then I'd like Rails to unzip that file and attach the images inside to my Photo's model via Paperclip, so that they are ultimately stored on my Amazon S3 account (configured through Paperclip). I'd like do do this all on my Rails site hosted on Heroku, which unfortunately doesn't allow local storage of any kind (so far as I'm aware) to temporarily do the unzipping before the Paperclip parsing.

Unzipping larger files with PHP

喜你入骨 提交于 2019-12-07 04:46:45
问题 I'm trying to unzip a 14MB archive with PHP with code like this: $zip = zip_open("c:\kosmas.zip"); while ($zip_entry = zip_read($zip)) { $fp = fopen("c:/unzip/import.xml", "w"); if (zip_entry_open($zip, $zip_entry, "r")) { $buf = zip_entry_read($zip_entry, zip_entry_filesize($zip_entry)); fwrite($fp,"$buf"); zip_entry_close($zip_entry); fclose($fp); break; } zip_close($zip); } It fails on my localhost with 128MB memory limit with the classic " Allowed memory size of blablabla bytes exhausted

How to unzip a zip file already loaded in memory in C?

回眸只為那壹抹淺笑 提交于 2019-12-06 22:26:28
I am writing a server, which receive a zip file from client, and unzip the file. When I receiving the zip file, I store it into memory. I find and try some library to upzip a zip file, such zlib and minizip, but all of them unzip a file exists on disk, not from memory. I don't want to save the file into disk temperorily and extract it, it's not efficient. How to unzip a file from memory? I write C and C++ on Windows. zlib supports in-memory inflate() and deflate() functions. You can read how from here Take a look at libarchive It supports the zip format. Example of extracting archive in memory

Unzip NSData without temporary file

浪尽此生 提交于 2019-12-06 20:11:19
问题 I've found a couple of libs (LiteZip and ZipArchive) that allow to unzip files on iPhone. But both of them require an input as a file. Is there a library that allows to directly unzip NSData containing zip-archived data without writing it to temporary file? I've tried to adopt mentioned above libs for that, but with no success so far. 回答1: In this answer to this question, I point out the CocoaDev wiki category on NSData which adds zip / unzip support to that class. This would let you do this

Ubuntu 16.04如何解压缩.zip 和 .rar文件?

流过昼夜 提交于 2019-12-06 18:51:18
1) Ubuntu 16.04 已经自动安装了unzip 软件,解压命令: unzip FileName.zip 2) 如果没有安装unzip,可以使用下面的命令安装: sudo apt install unzip 3) 安装unrar软件 sudo apt install unrar 4) 解压rar文件: unrar x FileName.rar 来源: 51CTO 作者: J丁贵强 链接: https://blog.51cto.com/4563839/2147506