home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Jason Aller Floppy Collection
/
341.img
/
TCS161S.ZIP
/
PKCON.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1989-07-17
|
5KB
|
172 lines
program PKCON;
uses dos, (* DOS access unit *)
crt; (* CRT access unit *)
(*---- Draws "NOW PROCESSING" pretty box ----------------------*)
procedure prettyboxes;
begin
clrscr;
gotoxy(1,1);
textcolor(9);
writeln(' PK-ZIP v.92 -> v1.00 Conversion');
write (' Written by: ');
textcolor(12);
write ('Paradigm Ghod');
textcolor(8);
write (' - ');
textcolor(12);
writeln('TCS');
textcolor(10);
writeln;
writeln(' Now Processing');
textcolor(11);
writeln(' ╓──────────────╖');
writeln(' ║ ║');
writeln(' ╙──────────────╜');
end;
(*---- Removes files from temporary directory -----------------*)
Procedure RemoveTemp;
var sucval:byte;
procedure cleanslate;
begin
gotoxy(1,20);
write (' ');
end;
begin
sucval:=64;
repeat
inc(sucval);
gotoxy(1,20);
exec('C:\dos\command.com','/C ERASE '+chr(sucval)+'???????.* >NUL');
cleanslate;
until sucval=91;
sucval:=47;
repeat
inc(sucval);
gotoxy(1,20);
exec('C:\dos\command.com','/C ERASE '+chr(sucval)+'???????.* >NUL');
cleanslate;
until sucval=58;
exec('C:\dos\command.com','/C ERASE $*.* >NUL');
cleanslate;
exec('C:\dos\command.com','/C ERASE %*.* >NUL');
cleanslate;
exec('C:\dos\command.com','/C ERASE (*.* >NUL');
cleanslate;
exec('C:\dos\command.com','/C ERASE )*.* >NUL');
cleanslate;
exec('C:\dos\command.com','/C ERASE #*.* >NUL');
cleanslate;
exec('C:\dos\command.com','/C ERASE &*.* >NUL');
cleanslate;
end;
(*---- Does conversion from PK .92 to PK 1.00 -----------------*)
procedure doconversion (var ffinfo:searchrec; var main:string);
var a :integer;
begin
gotoxy(32,6);
write(' ');
gotoxy(33,6);
textcolor(13);
a:=ffinfo.attr;
if (a and 1)=1 then exit;
if (a and 2)=2 then exit;
if (a and 4)=4 then exit;
if (a and 8)=8 then exit;
if (a and 16)=16 then exit;
write (ffinfo.name);
textcolor(9);
gotoxy(1,11);
chdir(main);
writeln (' Extracting Archive - Please Wait ');
exec ('C:\DOS\COMMAND.COM','/C pkunzip '+ffinfo.name+' C:\TEMP >NUL');
chdir ('C:\TEMP');
textcolor(9);
gotoxy(1,11);
write (' Compressing files with IMPLOSION - please wait ');
exec ('C:\DOS\COMMAND.COM','/C pkzip -ex -a '+ffinfo.name+' *.* >NUL');
textcolor(9);
gotoxy(1,11);
write (' Moving compressed file to '+main+' - please wait ');
exec ('C:\DOS\COMMAND.COM','/C copy '+ffinfo.name+' '+main+' >NUL');
textcolor(9);
gotoxy(1,11);
write (' Removing file from your system - please wait ');
exec ('C:\DOS\COMMAND.COM','/C del '+ffinfo.name+' >NUL');
gotoxy(1,11);
write (' Removing unzipped files from temporary directory - please wait ');
RemoveTemp;
chdir (main);
end;
(*---- Searches directory for wildcard - Then converts if found ------*)
procedure directory;
var r :registers;
ffinfo :searchrec;
tpath :string[80];
b :byte;
cnt :integer;
inputlam :string[40];
maindir :string[40];
begin
{ getdir (defaultdrive,tpath); }
tpath:='C:\*.ZIP';
textcolor(12);
write ('Path');
textcolor(10);
write ('/');
textcolor(12);
write ('Wildcard');
textcolor(13);
write (' [');
textcolor(9);
write ('CR');
textcolor(10);
write ('-');
textcolor(9);
write (tpath);
textcolor(13);
write (']');
textcolor(11);
write (':');
textcolor(14);
readln(inputlam);
if length(inputlam)<>0 then tpath:=inputlam;
Write('Please enter your current path name [CR-C:\DL\]');
readln(maindir);
if maindir='' then maindir:='C:\DL';
findfirst ('C:\*.*',8,ffinfo);
findfirst (tpath,$17,ffinfo);
textcolor(8);
if doserror<>0 then writeln ('There were no files found matching those specifications.') else begin
prettyboxes;
cnt:=0;
while doserror=0 do begin
inc(cnt);
doconversion (ffinfo,maindir);
findnext (ffinfo)
end;
gotoxy(1,6);
textcolor(14);
gotoxy(1,15);
writeln (' Total Converted Files: ');
textcolor(11);
writeln (cnt)
end;
end;
begin
clrscr;
mkdir('C:\TEMP');
directory;
rmdir('C:\TEMP');
end.