我正在使用Delphi提供的TZipFile类,我想知道是否可以在没有压缩的情况下打包/解压缩,就像unix.In中的tar命令一样--我们在将文件提取和写入包时寻求最大的效率。谢谢。
发布于 2020-04-08 20:39:34
解决方案:压缩-非压缩-德尔菲
关键是在过程中使用ZcStored选项。
随函附上一个回答我问题的工作示例,以防有人陷入Tom 善意解决的问题。
//使用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;

https://stackoverflow.com/questions/61108369
复制相似问题