.; NEWLD.IND, IND Control File. .; Creates a new logical disk file and mounts it as LD6 .; with a specified logical assignment. If LD6 is in use, the .; new file is mounted as LD7. .; .; The filespec will be parsed and defaults provided if necessary. .; The default device on which new files are to go can be specified .; in this file. .; File sizes can be specified in one of two ways: .; Either as a number of blocks or as a disk "type". Currently defined .; disk types are DX (494 blocks), DU (800 blocks), DY (988 blocks), .; FW (2432 blocks) or DL (10210 blocks). .; The number of directory segments will either be automatically chosen .; or can be specified at runtime. .; For files specified by numerical size, the default is to add the .; directory size onto the number specified (thus a specification of .; 300 blocks would result in a 308-block file). This gives you the .; "gross" amount of space specified. This can be overridden .; with a switch to cause the useable blocks in the file to be the "net" .; amount after subracting off the directory from the specified .; file size. .; If a logical name assignment is not given, the new file is .; assigned to DK. .; .; The parameters of the control file are: .; P1 Filespec (default is DEFDEV:xxxxxx.DSK). .; P2 Number of file blocks or disk type. .; P3 Logical assignment (default is DK). .; P4 Number of directory segments (default is automatic .; specification). .; P5 "Net" or "Gross" file size (N or G, default is N). .; .; The file SY:CURDK.TMP holds the current default information. .; .; Written by: .; R. W. Barnard .; BIO/Comp Applications .; Albuquerque, NM 87185 .; .; Version 1.5; 20-Oct-86. .; .enable quiet .disable lowercase .disable prefix,suffix .disable octal SET TT QUIET .; .; Change disk types and sizes here (separate by spaces). .sets DSKTYP "DX DU DY FW DL " .;Two-char disk types only. .sets TYPSIZ "494 800 988 2432 10210" .;Corresponding sizes. .; NOTE! If you add any disk types, add another SIZn below! .parse TYPSIZ " " SIZ1 SIZ2 SIZ3 SIZ4 SIZ5 .; Specify default for new files here. .sets DEFDEV "DK" .; Specify Volume ID owner name here. .sets OWNAME "RWB" .; .start: .if P1 ne "" .goto 10 .asks P1 What is the filespec for the new subdevice .parse P1 " " P1 P2 P3 P4 P5 .goto start .; .10: .parse P1 ":" DEV FNAME .if FNAME ne "" .goto 30 .;Device was entered. .sets FNAME DEV .sets DEV DEFDEV .;Device not entered - use default. .; 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 complete file name. .; .sets LOGICL "DK" .;Establish the logical name. .if P3 ne "" .sets LOGICL "'P3'" .; .; See if the file already exists. .testfile 'DEV':'FILNAM' .if eq .goto exists .; .sets DS P2 .if DS ne "" .goto 45 .;File size or type specified. .getsiz: .asks DS Enter file size or disk type (? for help) .if gt 1 .goto 45 ;ESizes are >10 blocks; types are 'DSKTYP' .goto getsiz .; .45: .sets DQ DS[1:1] .if DQ le "9" .goto 49 .;Numerical file size. .; Get rid of :, if typed. .parse DS ":" DS A .setn COUNT 1 .;Get length of disk type string. .test DSKTYP .disq: .;Figure out disk type. .sets DISKS DSKTYP[COUNT:COUNT+1] .if DS eq DISKS .goto 47 .;Now compare entry with list .setn COUNT COUNT+3 .;of disks. .if COUNT lt .goto disq ;No disk type with that name .goto getsiz .;Try again. .; .47: .setn INDX COUNT/3+1 .;Compute index for disk we are using. .sets DS SIZ'INDX' .;Now get the size. .sets P5 "G" .;Specified file types are always "gross". .; .49: .if P4 eq "" .sets P4 "0" .;Can't set numerics to blank. .setn SS 'P4' .;Determine number of segments. .if SS ne 0 .goto 50 .setn SS 3*('DS'/800)+1 .;First cut at number of segments. .if SS gt 16 .setn SS 16 .;That's enough. .; .50: .setn DSKSIZ 'DS' .;Now specify the file size. .sets GORN P5 .;Make upper case. .if GORN ne "G" .setn DSKSIZ DSKSIZ+(SS*2)+6 .;Add direc size. .testdevice 'DEV' .parse "," DEVNAM SIZE A1 A2 A3 LOAD ONL MOU NAT CREATE 'DEVNAM':'FILNAM'/ALL:'DSKSIZ' .if ne .exit .; .; Now do the logical assignment. ASS 'DEV' 'LOGICL' .sets CURLD "LD6" .;See if we are already down one level. .if DEVNAM eq CURLD .sets CURLD "LD7" .; MOUNT 'CURLD' 'DEVNAM':'FILNAM' 'LOGICL' .if ne .exit .open SY:INI.TMP .enable data R DUP 'CURLD':/Z/V/Y/N:'SS'. 'FILNAM' 'OWNAME' ^C SET TT NOQUIET .disable data .close $@SY:INI.TMP DELETE/NOQ SY:INI.TMP .; .; Show where we are. .open SY:CURDK.TMP .data E 'DEVNAM':'FILNAM' is 'LOGICL', mounted on 'CURLD'  .close .; Message is printed bold, and is positioned better on screen. TYPE SY:CURDK.TMP DIR/VOL 'LOGICL': .; .exit .; .exists: ;E File '' already exists - .ask [] QQ Do you want to attach it [N] .ift QQ @SY:DOWN '' 'LOGICL' .exit