%%s 0/0/0 %%d D 1.1 26-Mar-82 12:32:25 v1.1 1 0 %%c Version 1.1 is the Spring 1982 Distribution of the LBL/Hughes release %%c of the Software Tools Virtual Operating System software and documentation. %%T %%I 1 #-h- mkd.r 2206 asc 25-mar-82 07:32:56 v1.1 (sw-tools v1.1) #-h- main 2133 asc 25-mar-82 07:32:41 v1.1 (sw-tools v1.1) DRIVER(mkd) character args(ARGBUFSIZE), buf(MAXLINE), grp(10), mem(10) character dir(FILENAMESIZE), ufd(FILENAMESIZE), pid(PIDSIZE) character ufdcmd(ARGBUFSIZE) character clower integer junk, i, j, int, desc integer getarg, spawn, getwrd, length, prompt, create, opendr string local "local" string part1 "pip [0,377]" string part2 ".dir=[0,0]" string part3 ".dir/en" string usestr "usage: mkd name g,m" string pstr "Continue [y/n] ?" string cmdfil "[0,377]mkd.cmd" string p1 "ufd sy0:[" string root "sy0:[0,377]" string ufdfmt "ufd %s" call query(usestr) if (getarg(1, dir, FILENAMESIZE) == EOF) call error(usestr) if (getarg(2, ufd, FILENAMESIZE) == EOF) call error(usestr) if (opendr(root, desc) == ERR) # sy:[0,377] does not exist { call sprint(ufdcmd, ufdfmt, root) call putlnl(ufdcmd, STDOUT) junk = prompt(pstr, buf, STDIN) if (clower(buf(1)) != 'y') return junk = spawn(local, ufdcmd, pid, WAIT) } else call closdr(desc) call sprint(args, "sy0:[%s]", ufd) if (opendr(args, desc) == ERR) { call sprint(ufdcmd, ufdfmt, args) call putlnl(ufdcmd, STDOUT) junk = prompt(pstr, buf, STDIN) if (clower(buf(1)) != 'y') return junk = spawn(local, ufdcmd, pid, WAIT) } else call closdr(desc) i = index(ufd, ',') if (i == 0) call error(usestr) ufd(i) = ' ' i = 1 junk = getwrd(ufd, i, grp) junk = getwrd(ufd, i, mem) i = 1 call stcopy(part1, 1, args, i) call stcopy(dir, 1, args, i) call stcopy(part2, 1, args, i) for (j=length(grp)+1; j <= 3; j=j+1) call chcopy('0', args, i) call stcopy(grp, 1, args, i) for (j=length(mem)+1; j <= 3; j=j+1) call chcopy('0', args, i) call stcopy(mem, 1, args, i) call stcopy(part3, 1, args, i) call putlnl(args, STDOUT) if (prompt(pstr, buf, STDIN) != EOF) andif (clower(buf(1)) == 'y') { junk = spawn(local, args, pid, WAIT) int = create(cmdfil, APPEND) if (int == ERR) call error("Error appending pip command to [0,377]mkd.cmd") else { call putlin(args, int) call putch('@n', int) call close(int) } } DRETURN end #-h- mkd.fmt 2829 asc 25-mar-82 07:32:58 v1.1 (sw-tools v1.1) .so ~bin/manhdr .hd Mkd (1) 12-Mar-82 make alpha-numeric directory for ODS-1 .sy mkd name g,m .ds `mkd' permits the association of an alph-numeric name with an UIC. After this association, the tools I/O system is able to reference files as dd:[name]filespec instead of using the G,M UIC format. This association is made WITHOUT modifying any RSX-11M software, and only uses the capability of creating directory entries which point to existing files. .sp The UIC [0,377] on the current disk (SY:) is used to keep two types of files: .sp .in +3 .ti -3 1. name.dir, which has been created via the following pip command .sp pip [0,377]name.dir=[0,0]gggmmm.dir/en .sp This simply causes a directory entry in [0,377] to be created which points to the directory file in [0,0]. .sp .ti -3 2. mkd.cmd, which is a composite of all of the above pip commands used, to permit regeneration of the aliases after backups (see below). .sp .in -3 To make an alias for a directory, issue the following command: .sp .ce mkd name g,m .sp Upon receiving the command, `mkd' performs the following steps: .sp .in +3 .ti -3 1. Check to see if sy:[0,377] exists. If not, format up an UFD command to execute and display to the requestor. The user is prompted if he/she wishes to continue. If the answer is affirmative, UFD is spawned and waited for to create [0,377]. .sp .ti -3 2. Check to see if sy:[g,m] exists. If not, the procedure in 1 is repeat, only for [g,m]. .sp .ti -3 3. Format up the pip command and display to the requestor. If the user specifies that he/she wishes to continue, then the pip command to create the alias is spawned and waited for, as well as the pip command is also appended to sy:[0,377]mkd.cmd. .sp .in -3 The only "gotcha" to this whole procedure concerns BRU backups, since BRU does not handle multiple directory entries to the same file in a coherent fashion. This is the reason that the file sy:[0,377]mkd.cmd is kept. When doing a backup, the suggested procedure is as follows: .sp .in +3 .ti -3 1. Run the following pip command >pip sy:[0,377]*.dir/rm Note the use of the "rm" switch and NOT the "de" switch, as this only removes the directory entry and NOT the directory itself, which could be critical. .sp .ti -3 2. Do whatever backups you wish. .sp .ti -3 3. After backup completion, execute the following command on the disks which been created as well as the source disk .sp >asn ddn:=sy: .br >@[0,377]mkd .sp This should be performed for each such disk. This re-establishes the aliases on the disks. .sp .in -3 This procedure is NOT needed for DSC, as it is intelligent in its handling of file aliases, whatever other faults it has. .fl sy:[0,377]mkd.cmd .br sy:[0,377]name.dir .sa lsd - list alpha-numeric directories .br prd - print current working alpha-numeric directory .di .au Joe Sventek .bu %%E 1