zip

Delphi XE2 TZipFile: replace a file in zip archive

半腔热情 提交于 2021-02-07 02:11:02
问题 I'd like to replace a file (= delete old and add new) in a zip archive with the Delphi XE2/XE3 standard System.Zip unit. But there are no replace/delete methods. Does anybody have an idea how it could be achieved without needing to extract all files and add them to a new archive? I have this code, but it adds the "document.txt" once more if it's already present: var ZipFile: TZipFile; SS: TStringStream; const ZipDocument = 'E:\document.zip'; begin ZipFile := TZipFile.Create; //Zipfile:

Delphi XE2 TZipFile: replace a file in zip archive

点点圈 提交于 2021-02-07 02:06:25
问题 I'd like to replace a file (= delete old and add new) in a zip archive with the Delphi XE2/XE3 standard System.Zip unit. But there are no replace/delete methods. Does anybody have an idea how it could be achieved without needing to extract all files and add them to a new archive? I have this code, but it adds the "document.txt" once more if it's already present: var ZipFile: TZipFile; SS: TStringStream; const ZipDocument = 'E:\document.zip'; begin ZipFile := TZipFile.Create; //Zipfile:

Delphi XE2 TZipFile: replace a file in zip archive

纵饮孤独 提交于 2021-02-07 02:06:23
问题 I'd like to replace a file (= delete old and add new) in a zip archive with the Delphi XE2/XE3 standard System.Zip unit. But there are no replace/delete methods. Does anybody have an idea how it could be achieved without needing to extract all files and add them to a new archive? I have this code, but it adds the "document.txt" once more if it's already present: var ZipFile: TZipFile; SS: TStringStream; const ZipDocument = 'E:\document.zip'; begin ZipFile := TZipFile.Create; //Zipfile:

Zip a byte array in Go

有些话、适合烂在心里 提交于 2021-02-06 08:57:45
问题 I am trying to take a chunk of bytes and compress them using the archive/zip package in Go. However, I can't understand it at all. Are there any examples of how it could be done and is there any explanation of that cryptic package? 回答1: Thanks to jamessan I did find the example (which doesn't exactly catch your eye). Here is what I come up with as the result: func (this *Zipnik) zipData() { // Create a buffer to write our archive to. fmt.Println("we are in the zipData function") buf := new

How to decompress a zip file in Azure Data Factory v2

一世执手 提交于 2021-02-05 11:40:59
问题 I'm trying to decompress a zip file (with multiple files inside) using Azure Data Factory v2. The zip file is located in Azure File Storage. The ADF Copy task just copies the original zip file without decompressing it. Any suggestion on how to make this work? This is the current configuration: The zip file source was setup as a binary dataset with Compression Type = ZipDeflate. The target folder was also setup as a binary dataset but with Compression Type = None. A pipeline with a single Copy

Extract Specific Filetypes From Multiple Zips to one Folder in Powershell

夙愿已清 提交于 2021-01-29 15:47:36
问题 I have Several zip files that Contain multiple filetypes. The ONLY ones I am interested in are the .txt files. I need to extract the .txt files only and place them in a folder of their own, ignoring all other file types in the zips files. All the zip files are in the same folder. Example -foo.zip --1.aaa --2.bbb --3.ccc --4.txt -foo2.zip --5.aaa --6.bbb --7.ccc --8.txt I want to have 4.txt and 8.txt extracted to another folder. I can't for the life of my figure it out and spent ages looking,

zip files without any metadata

烂漫一生 提交于 2021-01-29 14:04:15
问题 I'd like to find an easy way to zip a bunch of files without any file metadata (e.g., timestamps). The zip command seems to always perserve the metadata. I don't see a way to disable metadata. I'd like the solution be a command or at most a python script. Thanks. 回答1: As some of the posts have already pointed out most of the metadata fields in a zip header have to be present. If the file contents you are zipping are identical each time, then the only field that will be different is the

Is it possible to extract / read part of a file within a zip using powershell?

梦想与她 提交于 2021-01-29 13:09:17
问题 I have a powershell 4.0 script that does various things to organise some large zip files across an internal network. This is all working fine, but I am looking to make a few improvements. One thing that I want to do is extract some details that are within an XML file within the ZIP files. I tested this on some small ZIP files by extracting just the XML which worked fine. I target the specific file because the zip can contain thousands of files that can be pretty large. This worked fine on my

DotNetZip: creating zip with C# permissions issue

别等时光非礼了梦想. 提交于 2021-01-29 06:48:22
问题 I am using DotNetZip and have noticed that i am getting permission issues on Mac's. This seems to only occur when i use content disposition. ie if i just save it to disk using (ZipFile zip = new ZipFile(@"C:\zip\temp.zip")) { // this works fine } but if i use content disposition like so, on mac the user permissions are denied ( everyone group is unchecked) Response.ContentType = "application/zip"; Response.AddHeader("content-disposition", "filename=" + filename); using (ZipFile zip = new

Stream multiple files at once from a Django server

你。 提交于 2021-01-29 06:12:00
问题 I'm running a Django server to serve files from another server in a protected network. When a user makes a request to access multiple files at once I'd like my Django server to stream these files all at once to that user. As downloading multiple files at once is not easily possible in a browser the files need to be bundled somehow. I don't want my server having to download all files first and then serve a ready bundled file, because that adds a lot of timeloss for larger files. With zips my