example2.pas 633 B

123456789101112131415161718192021222324252627282930313233
  1. program EnhancedZipperExample;
  2. {$mode objfpc}{$H+}
  3. uses
  4. Classes, zstream, zipper;
  5. var
  6. z: TZipper;
  7. zfe: TZipFileEntry;
  8. begin
  9. z:=TZipper.Create;
  10. z.FileName:='fpcCompressionLevelTestFile.zip';
  11. try
  12. //Default Compression Level
  13. zfe:=z.Entries.AddFileEntry(ParamStr(0));
  14. //Compression Level = none ( Store )
  15. zfe:=z.Entries.AddFileEntry(ParamStr(0));
  16. zfe.CompressionLevel:=clnone;
  17. z.ZipAllFiles;
  18. finally
  19. z.Free;
  20. end;
  21. {
  22. The result can be checked with the command(On Linux):
  23. unzip -v fpcCompressionLevelTestFile.zip
  24. The column Method Shows different values to each file
  25. }
  26. end.