.; DOWN.IND, IND control file. .; Assigns default (or user-specified) logical name to .; specified logical disk file. .; The control file will search a predetermined sequence of .; devices looking for the file if the device is not specified. .; .; This command file can support up to two levels of logical .; disk nesting. It uses LD6 and LD7 for its operations. .; The first level is LD6, and the second (nested) one is LD7. .; The file SY:CURDK.TMP holds the current default information. .; .; The parameters of the control file are: .; P1 File name (XXXXXX.DSK is default). .; P2 Logical name (DK is default). .; .; When used in conjunction with a UCL, you can type .; DO[WN] FILNAM and have that file become the default. .; The UCL entry is .; DOWN == R IND\SY:DOWN ^1 ^2 (assuming you are using UCL+, .; Version 7.49 or later). .; (Also assuming you have patched IND to expect .IND as the default)! .; .; Written by: .; R. W. Barnard .; BIO/Comp Applications .; Albuquerque, NM 87185 .; .; Version 2.4; 21-Oct-86 .; .enable quiet .disable lowercase .disable prefix,suffix .disable octal .; .; Specify search order and number of disks to be searched here. .; If LD6 is first, you will search for nested files properly. .sets DISKS "LD6:DU0:FW6:FW5:FW4:DL0:DU3:DU1:DU2:FW0:" .; Must use three characters plus : for every device!! .setn NUMDSK 10*4 .;Number of devices (above) * 4. .; Specify default device here. .sets DEFDEV "" .;In this case, null becuase we want to search. .; .start: .if P1 ne "" .goto 10 .asks P1 Down to which file .parse P1 " " P1 P2 .goto start .; .10: .parse P1 ":" DEV FNAME .if FNAME eq "" .goto 20 .sets DEV DEV+":" .;Device was entered. .goto 30 .20: .sets FNAME DEV .;Device not entered. .sets DEV DEFDEV .;Use default device name. .; See if the filespec has a null extension. .30: .test P1 .sets EXTQ P1[:] .sett NULEXT .;If null ext, last char of filespec will be . .if EXTQ ne "." .setf NULEXT .parse FNAME "." FNAME EXT .if EXT ne "" .goto 40 .;Extension was entered. .iff NULEXT .sets EXT "DSK" .;Ext not entered - use default. .40: .sets FILNAM "'FNAME'.'EXT'" .;Build the file name. .; .if DEV ne "" .goto 70 .;Device name was supplied. .setn COUNT 1 .;Try to find file on devices. .setn UNMNT 1 .;Index of unmounted devices. .dsklp: .sets DEV DISKS[COUNT:COUNT+3] .; Look for the file on each disk. .testdevice 'DEV' .parse "," DEVNAM SIZE A1 A2 A3 LOAD ONL MOU NAT .; Don't check a file if no disk. .if ONL eq "OFL" .or .if DEVNAM eq "NSD" .goto 50 .testfile 'DEV''FILNAM' .if eq 230 .setn ERRSAV 230 .;Remember if no file. .if eq .goto 70 .;Found it. .goto 60 .50: .enable lowercase .sets NOMT'UNMNT' " 'DEV' is not mounted." .inc UNMNT .disable lowercase .60: .setn COUNT COUNT+4 .;Try again. .if COUNT gt NUMDSK .goto badnam .;Ran out of disks. .goto dsklp .; .70: .sets LOGICL "DK" .;Now do the logical assignment. .sets FILSPC "'DEV''FILNAM'" .;We also need complete file spec. .if P2 ne "" .sets LOGICL "'P2'" .sets CURLD "LD6:" .;See if we are already down one level. .if DEV eq CURLD .sets CURLD "LD7:" .; MOUNT 'CURLD' 'FILSPC' 'LOGICL' .if ne .exit .; .; Show where we are. .open SY:CURDK.TMP .data E 'FILSPC' is 'LOGICL', mounted on 'CURLD' .close .; Message is printed bold, and is positioned better on screen. TYPE SY:CURDK.TMP .; .exit .; .badnam: .;See what's wrong. .if ERRSAV eq 230 ;E No such file 'FILNAM' on any device. .sets NOMT'UNMNT' "" .;Report on disks not mounted. .setn UNMNT 1 .enable lowercase .badlp: .;Keep reporting disks not mounted .if NOMT'UNMNT' eq "" .exit .sets A1 NOMT'UNMNT' .;until reaching a blank. ;'A1' .inc UNMNT .goto badlp