home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.barnyard.co.uk
/
2015.02.ftp.barnyard.co.uk.tar
/
ftp.barnyard.co.uk
/
cpm
/
walnut-creek-CDROM
/
ENTERPRS
/
CPM
/
UTILS
/
A
/
ARC20.ARC
/
ARC.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1989-11-22
|
5KB
|
119 lines
program arc; { ARCCPM Version 2.0 }
(* TR 101189 *)
{$I CLINE127.INC } (* 127-Character Commandline Patch *)
{$I ARCDEF.INC } (* ARCCPM Variable Type Definition *)
(* Vordefinierte Variablen des Hauptprogramms: Default-Einstellung *)
const title = 'ARC for CP/M, TURBO-Version 22.11.89 (TR)';
kludge : boolean = true; (* Komprimieren versuchen *)
force : boolean = false; (* nicht immer crunchen *)
warn : boolean = true; (* Fehlermeldungen anzeigen *)
note : boolean = true; (* Hinweise anzeigen *)
keepbak : boolean = false; (* Kein ARC-Backup anlegen *)
pass : string[10] = ''; (* Kein Passwortschutz *)
cmd : char = #0; (* noch kein Befehl gueltig *)
empty = 'Archive empty - nothing done!';
(* Globale Variablen des Hauptprogramms *)
var arg : arglist;
time : boolean;
cmdstr,arcname,newname,bakname : filenam;
arcpath : str4;
newarc,oldarc : binfile;
pcount : byte;
gi,arcdate,arctime : integer;
(* Globale Variablen fuer Unterprogramme gemeinsam *)
orgfile : binfile;
header : headtype;
did : flaglist;
found,bdummy : boolean;
{$I ARCMISC.INC } (* Grundfunktionen, Mathe *)
{$I ARCFUNC.INC } (* Binaer-File-I/O *)
{$I ARCDIR.INC } (* Directory-Funktionen *)
{$I ARCIO.INC } (* ARC-File-I/O *)
{$I ARCSQU.INC } (* Un/Squeezing *)
{$I ARCLZW.INC } (* Un/Crunching (LZW) *)
{$I ARCPACK.INC } (* Komprimieren/Expandieren *)
{$I ARCLST.INC } (* ARC-Inhalt zeigen *)
{$I ARCEXT.INC } (* Dateien extrahieren *)
{$I ARCDEL.INC } (* Dateien loeschen *)
{$I ARCADD.INC } (* Dateien einfuegen *)
procedure showhelp;
begin
write(
' ARCCPM - an ARCHIVE Utility for CP/M-80 (V 2.2 & 3.0)'^M^J,
' -----------------------------------------------------'^M^J,
' Version 2.0 - Turbo Pascal 3.00A - Nov.1989'^M^J^J,
' Public domain by Reimer Mellin, Muenchen'^M^J,
' Enhanced Rewriting by Tilmann Reh, Siegen'^M^J^J,
' > NOTE: FOR PRIVATE NON-COMMERCIAL USE ONLY <'^M^J^J,
' U S A G E :'^M^J^J,
' ARC adelmvx (bknstw) (g<passw>) <arch> (<fname>..)'^M^J^J,
' a = add files to archive b = keep backup of archive'^M^J,
' d = delete from archive k = force crunching'^M^J,
' x,e = extract from archive n = suppress notes'^M^J,
' l,v = list files in archive s = store only'^M^J,
' m = move files to archive t = set date and time'^M^J,
' g = Encrypt/decrypt entry w = suppress warnings'^M^J^J,
' ( Refer to ARCCPM.DOC for complete documentation ... )'^M^J);
end;
(*----- MAIN -----*)
begin
if paramcount<2 then showhelp else begin
writeln(^M^J,title,^M^J);
time:=(bdoshl(12)>=$30);
cmdstr:=paramstr(1); arcname:=paramstr(2);
pcount:=pred(pred(paramcount));
for gi:=1 to pcount do arg[gi]:=paramstr(succ(succ(gi)));
gi:=pos(':',arcname);
if gi=0 then arcpath:='' else begin
arcpath:=copy(arcname,1,gi); delete(arcname,1,gi); end;
makefnam(arcname,'.ARC',arcname);
makefnam(arcname,'.$$$',newname); (* ARCPATH erst bei OPENARC *)
makefnam(arcname,'.BAK',bakname);
gi:=1; repeat
case cmdstr[gi] of
'A','D','E','L','M','V','X' : begin
if cmd<>#0 then begin
writeln('Cannot mix ',cmd,' and ',cmdstr[gi]);
halt; end;
cmd:=cmdstr[gi];
end;
'B': keepbak:=true;
'W': warn:=false;
'N': note:=false;
'S': kludge:=false;
'K': force:=true;
'T': time:=false;
'G': begin
pass:=copy(cmdstr,succ(gi),gi+21);
gi:=length(cmdstr);
end;
'-','/':;
else begin
writeln(cmdstr[gi],' is an unknown command!');
halt; end;
end;
gi:=succ(gi);
until gi>length(cmdstr);
if cmd=#0 then begin writeln('I have nothing to do ...'); halt; end;
get_global_datetime;
case cmd of
'A','M' : addarc;
'D' : delarc;
'E','X' : extarc;
'V','L' : lstarc;
end;
end;
end.