program filini c********************************************************************** c c FILINI.TSK c c This program initialises the File Manager data base file, which c is LB:[1,7]FILESPEC.SYS. c Any previous existing versions are destroyed. c This program MUST be run ONCE before using the FILEDEF command c and the File Manager task (FIL...). It is recommended that c FILINI be run in the system startup file to initialise the c system, in the event that a system crash has left assignments c in the file. c c Version 1.00 May 1982 c c Steve Thompson c School of Chemical Engineering c Olin Hall c Cornell University c Ithaca NY 14853 c (607) 256 3895 c c*********************************************************************** include 'filparam.inc' c c-------Announce ourselves c type 901 c c-------Modify default OTS error handling c call errset(28,.true.,.false.,.true.,.false.) ! Open errors call errset(29,.true.,.false.,.true.,.false.) ! ditto call errset(30,.true.,.false.,.true.,.false.) ! ditto c c-------Zero dummy record c do 10 i = 1,8 do 10 j = 1,maxlun record(i,j) = 0 10 continue c c-------Look for previously existing data base file and delete it c open(unit=1,file='LB:[1,7]FILESPEC.SYS',status='old', 1 access='direct',err=50) close(unit=1,dispose='delete',err=501) 50 continue c c-------Determine parameters for creating a new file c maxtt = maxtty + 1 maxvt = maxvty + 1 maxrcd = maxtt + maxvt c c-------Create the new file c open(unit=1,file='LB:[1,7]FILESPEC.SYS',status='new', 1 access='direct',recordsize=4*maxlun,maxrec=maxrcd, 2 err=502) c c-------Write blank records to it c do 100 irec = 1,maxrcd write(unit=1,rec=irec,err=503) record 100 continue c c-------Close new file and exit c close(unit=1) type 950 call exst(1) c c-------Error returns c 501 type 902 call exst(4) 502 type 903 call exst(4) 503 type 904 close(unit=1,dispose='delete') call exst(4) c c-------Format statements c 901 format(' FILINI Version 1.00') 902 format(' FILINI -- Error deleting old data base file') 903 format(' FILINI -- Error creating new data base file') 904 format(' FILINI -- I/O error on data base file') 950 format(' FILINI terminated successfully') end