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
/
ARCEXT.INC
< prev
next >
Wrap
Text File
|
1989-11-10
|
1KB
|
43 lines
(* ARCEXT.INC TR 101189 *)
(* angegebene Datei(en) aus Archive extrahieren *)
procedure extarc;
var paths : array[1..10] of char;
i,n : byte;
procedure extfile(path:char);
var nam : filenam;
begin
nam:=pstring(header.name);
if path<>#0 then nam:=path+':'+nam;
if note then writeln('Extracting File: ',nam);
fopen_write(nam,orgfile);
unpack(oldarc,orgfile,header);
fclose(orgfile);
end;
begin { extarc }
for n:=1 to pcount do begin
did[n]:=false;
i:=pos(':',arg[n]);
if i=0 then paths[n]:=#0 else begin
paths[n]:=arg[n][1]; delete(arg[n],1,i); end;
end;
if openarc(false) then begin
if pcount=0 then while readhdr(header,oldarc) do extfile(#0)
else while readhdr(header,oldarc) do begin
found:=false; n:=0;
repeat
n:=succ(n);
if match(pstring(header.name),arg[n]) then begin
found:=true; did[n]:=true; end;
until found or (n>=pcount);
if found then extfile(paths[n]) else fskip(oldarc,header.size);
end;
note_notfound;
closearc;
end
else writeln(empty);
end;