簡體   English   中英

Zip 無壓縮(德爾福)

[英]Zip without compression (Delphi)

I am using the TZipFile class provided natively by Delphi and I am wondering if it is possible to pack / unpack without compression , similar to the tar command in unix.In this case, we seek the greatest efficiency in extracting and writing files into a package . 謝謝。

解決方案: zip-without-compression-delphi

關鍵是在 TZipFile.Add 過程中使用ZcStored選項。

附件是一個回答我的問題的工作示例,以防萬一有人遇到湯姆布倫伯格友好解決的問題

// 使用 system.zip;

Procedure MakeZipFile;
Var
 fZip: TzipFile;
 PathZip, MyPathFile: String;
begin
 fZip := TZipFile.Create;
 Try
   PathZip := 'C:\example.zip';
   MyPathFile := 'C:\myfile.txt';
   fZip.Open(PathZip, zmWrite);
   fZip.Add(MyPathFile, '', ZcStored); // Thanks Tom
   fZip.Close;
 Finally
   fZip.Free; 
 end;
end;

壓縮類型 Tzipfile Delphi

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM