DataMuseum.dk

Presents historical artifacts from the history of:

RC4000/8000/9000

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about RC4000/8000/9000

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦714d1875d⟧ TextFile

    Length: 96768 (0x17a00)
    Types: TextFile
    Names: »backuptx    «

Derivation

└─⟦110021343⟧ Bits:30007476 RC8000 Backup tape fra HT's bus-radio system
    └─⟦a957ba283⟧ 
        └─ ⟦this⟧ »backuptx    « 

TextFile

begin
  <* programmet backup omdøber en fil til et backupnavn ved at tilføje
     (evt. ændre) 3 tegn sidst i navnet: x00.

     tidligere backup-versioner af samme navn omdøbes så tallet i postfix
     førhøjes med een: ...x00 -> ...x01, ...x01 -> ...x02 osv.

     der gemmes maximalt et angivet (default 10) antal inkarnationer, 
     således at ældste incarnation slettes.

     kald:  backup fil.<filnavn> inc.<maxinkarnationer>

  ændringshistorie:
  =================

     930126 cl : original version.
  *>
\f


  integer array ia(1:4);
  integer maxinc;

  if findfpparam(<:inc:>,true,ia) < 1 then maxinc:= 10 else maxinc:= ia(1);

  begin
    long array navne(0:maxinc*2+1);
    integer i,p,ch,m;
    integer array field iaf;
    long array field laf,laf1;
    zone zhelp(1,1,stderror);
    integer array tail(1:10);
    
    errorbits:=3;
    iaf:= laf:= -4;
    navne(0):=navne(1):= long<::>;
    if findfpparam(<:fil:>,false,navne.iaf) < 1 then
    begin
      write(out,<:*** backup: filnavn mangler!:>);
      flushout('nl');
      goto slut;
    end;

    open(zhelp,0,navne.laf,0);
    if monitor(42)lookup_entry:(zhelp,0,tail)<>0 then
    begin
      write(out,<:*** backup: filnavn ":>,navne.laf,<:" ukendt!:>);
      flushout('nl');
      goto slut;
    end;
    close(zhelp,true);

    p:=1;
    repeat
      if get_char(navne.laf,p+0,ch) extract 12 <> 0 then p:=p+1;
    until p=12 or ch=0;
    if p > 9 then p:= 9;

    for i:= 1 step 1 until maxinc do
    begin
      laf1:= laf+8;
      tofrom(navne.laf1,navne.laf,8);
      put_char(navne.laf1,p+0,'x');
      put_number(navne.laf1,p+1,<<zd>,i-1);
      laf:= laf1;
    end;

    laf1:= laf+8;
    for i:= maxinc step -1 until 0 do
    begin
      open(zhelp,0,navne.laf,0);
      if monitor(42)lookup_entry:(zhelp,0,tail) = 0 then
      begin
        if i=maxinc then 
        begin
          m:= monitor(48)remove_entry:(zhelp,0,tail);
          if m=0 then
          begin
            write(out,<:+++ :>,navne.laf,<: slettet:>);
            flushout('nl');
          end;
        end
        else
        begin
          iaf:= laf1;
          m:= monitor(46)rename_entry:(zhelp,0,navne.iaf);
          if m=0 then
          begin
            write(out,<:+++ :>,navne.laf,<: omdøbt til :>,navne.laf1);
            flushout('nl');
            if i=0 then errorbits:=0; <*hovedfil omdøbt ok*>
          end;
        end;
        if m<>0 then
        begin
          write(out,<:*** backup: :>,navne.laf,<: monitor-result=:>,<<d>,m);
          flushout('nl');
        end;
      end;
      laf1:=laf;
      laf:=laf-8;
      close(zhelp,true);
    end;
  end;
slut:
  trapmode:= 1 shift 10;
end
▶EOF◀