Archived
1
0
This repository has been archived on 2025-03-31. You can view files and clone it, but cannot push or open issues or pull requests.
pascal/PZIP.PAS
2001-11-30 12:14:44 +01:00

45 lines
754 B
Plaintext

program pZipCompressor;
uses Crt, Dos;
var infile, outfile: file;
insize, outsize: longint;
infname, outfname: string;
procedure Init;
begin
infname := ParamStr(1);
Assign(infile,infname);
Reset(infile);
insize := FileSize(infile);
Close(infile);
end;
procedure ExecPacker;
begin
SwapVectors;
Exec(GetEnv('COMSPEC'),'/C pack_.bat '+infname);
SwapVectors;
end;
procedure After;
begin
Assign(outfile,'!'+infname);
Reset(outfile);
outsize := FileSize(outfile);
Close(outfile);
end;
procedure Out;
begin
WriteLn('Statistics');
WriteLn('Original size: ',insize,' Bytes');
WriteLn('Packed size: ',outsize,' Bytes');
end;
begin
Init;
ExecPacker;
After;
Out;
end.