perm filename TEST.SAI[USE,CSR] blob
sn#321566 filedate 1977-12-08 generic text, type C, neo UTF8
COMMENT ⊗ VALID 00002 PAGES
C REC PAGE DESCRIPTION
C00001 00001
C00002 00002 begin "test"
C00004 ENDMK
C⊗;
begin "test"
integer chan, eof, flag, count, brchar, ichan, error, dchan;
string foo;
open(dchan←getchan,"DSK",0,2,0,0,brchar,eof);
lookup(dchan,"TEST.BKP",flag);
if flag≠0 then print("something wrong in the lookup",(flag land '000000777777))
comment old file doesn't exist, so don't bother renaming it;
else begin comment found old file. delete it by renaming it to null;
rename(dchan,null,0,flag);
if flag≠0 then print("something wrong in the rename 0",(flag land '000000777777));
end;
close(dchan);
open(chan←getchan,"DSK",0,0,2,0,brchar,eof);
enter (chan, "TEST.TMP", flag);
open(ichan←getchan,"DSK",0,2,0,450,brchar,eof);
lookup(ichan, "TEST.DSK",flag);
out(chan,"last testng");
out(chan, "smorejfe");
out(chan,"laddjhfdjjkjdd;;");
print("wait");
foo←inchwl;
close(chan); lookup(chan,"TEST.TMP",flag);
rename(ichan,"TEST.BKP",'277,flag);
if flag≠0 then print("something wrong in the rename 1",(flag land '000000777777));
rename(chan,"TEST.DSK",'277,flag);
if flag≠0 then print("something wrong in the rename 2",(flag land '000000777777));
close(ichan);
close (chan);
end "test";