perm filename COPY.SAI[HAK,HPM] blob sn#435419 filedate 1979-04-25 generic text, type T, neo UTF8
begin "copy"

string INM, ONM, DV;
integer X;
integer array M[0:5];

integer procedure F (string S; integer K);
begin	while S = " " do X ← lop(S);
	DV ← scan (S, 2, X);
	if X ≠ ":" then begin S ← DV; DV ← "dsk" end;
	open (K, DV, 520, 19-K*18, K*19, 0, 0, X←0);
	lookup (K, S, X);
	fileinfo (M);
	if K then enter (K, S, X);
	if X then usererr (0, 0, "Can't " & (if K then "write " else "find ") & DV & ":" & S);
	return (-(M[3] rot 18))
end;

setbreak (1, "←=", null, "i");
setbreak (2, ":", null, "i");

print ("output←input: ");
INM ← inchwl;
ONM ← scan (INM, 1, X);
if length(INM) = 0 then call (0, "exit");

if f(INM, 0) < f(ONM, 1) then
begin	print ("Input too small; type Y to continue: ");
	if inchrw lor '137 ≠ "Y" then call (0, "exit");
	print ('15&'12)
end;

inout (0, 1, -1);
close (1)

end "copy"