New SD Utility -------------- The SD, SDDRAW, and LET utilities have been extensively updated. Please record and promptly communicate any problems with these new versions of SD, SDDRAW, and LET to: Alan Zirkle (703) 663-8023. NSWC Code K55 Dahlgren, VA 22448 The following notes summarize how this version of SD is different from (1) the last time I submitted SD, and (2) Dale Coy's submission of SD. System Management and Installation notes are at the end. SD.LQP uses LN03/LPS40 boldfacing, SD.DOC is for any printer. These and SD.HLP describe the syntax of SD. ___________________________________________________________________________ SD now keeps a history of the last 20 directories, not just 7. The display for "SD <<" is now interactive; you can see the last 20 directories, then pick one to travel to in the same step. Instructions are in the display. ___________________________________________________________________________ SD can save its history over logouts. Do "SD /SAVE" to save it before you log out, and "SD /RESTORE" when you log in. This works best if you have a LOGOUT.COM. The way I use this is: LOGIN.COM: $ SD /1=UDISK1: /2=UDISK2: /3=UDISK3: - ! Define six short- /4=UDISK4: /5=UDISK5: /6=UDISK6: ! hand operands $! $ IF F$MODE() .EQS. "INTERACTIVE" THEN - IF F$TRNLNM("SYS$REM_ID") .EQS. "" THEN SD /RESTORE $! $ LO*GOUT == "@SYS$LOGIN:LOGOUT" LOGOUT.COM: $ IF F$TRNLNM("SYS$REM_ID") .NES. - F$EDIT(F$GETJPI("","USERNAME"),"TRIM") THEN SD /SAVE $ LOGOUTnow ___________________________________________________________________________ As implied above in the LOGIN.COM coding, the mechanism for defining short- hand operands, which must be integers, has been changed. Instead of defin- ing DCL symbols, like: $ SD__9 == "UDISK9:" you now do: $ SD /9=UDISK9: You can now use values as high as you like. One useful shorthand might be: $ SD /0=[000000] then "SD 9 0" would go to UDISK9:[000000]. ___________________________________________________________________________ SD /HELP will now display help text; SD ? and SD HELP also still do this. SD /VERSION will now display the version number of SD; SD $ also still does this, but may not in the future. NOTE: if the user redefines the command HELP, SD may not display help text correctly. ___________________________________________________________________________ SD now accepts three new operand types. The first two work only if you are currently in a directory named [SYSn.xxxx], where N is any hex number, and XXXX is any subdirectory(s). The third works only for privileged users. The operands are: SD # If in [SYSi.xxx], go to [SYSj.xxx], where j=i+1 in hex SD #n If in [SYSi.xxx], go to [SYSn.xxx], where i and n are hex SD @username Go to login directory of the specified user (if username is blank, go to caller's login directory) A following blank is optional in the case: SD @username.subdir SD @username .subdir An example of using SD # is: $ SD 0 SYS0.SYSMGR (where "0" has been defined as SYS$SYSDEVICE:) $ DIR /SIZE *.LOG $ SD # DIR /SIZE *.LOG $ SD # DIR /SIZE *.LOG (recall previous command) $ ... " " " ___________________________________________________________________________ SD will optionally execute command files when it moves to a new directory. IF the directory moved FROM contains a file SDEXIT.COM, it may be run. If the directory moved TO contains a file SDENTRY.COM, it may be run. Running these is controlled by global DCL Symbol SD_COM. If it is undefined, these procedures get executed (when they exist in the directories). If SD_COM's value begins with "N", they are not executed. If the value begins with "Y", they are executed, and SD tells you when it does run them. The global DCL Symbol SD_COM can now be two characters long. If the second character is "Y", then SD will, whenever it changes directories, invoke your command procedure SYS$LOGIN:SD.COM. This procedure will be called BEFORE the directory is changed, and P1 will be the name of the directory where SD is travelling to. The procedure will be called before any SDEXIT.COM is called. An error message will be displayed if you have not provided an SD.COM. This provides a way, for example, for users to easily change the DCL prompt based on what directory they are going to. Users on VT3nn or VT4nn termin- als can use this to put the new directory name in the 25th line. ___________________________________________________________________________ If SD cannot find the specified directory in a rooted structure, it will attempt to find the directory elsewhere on the disk containing the root; for example: $ SD SYS$SYSTEM SYS$SYSROOT:[SYSEXE] $ SD DECNET SYS$SYSDEVICE:[DECNET] The second SD command above first searched for SYS$SYSROOT:[DECNET], which did not exist. It then determined that SYS$SYSROOT was a rooted structure on disk SYS$SYSDEVICE, so it then looked for SYS$SYSDEVICE:[DECNET], which it found. ___________________________________________________________________________ SD will now correctly handle directories in the legal formats dev: (i.e. using angle brackets) and dev:[n1,n2] or dev: (octal UIC for- mat; n1 and n2 must be octal numbers of 1-3 digits). ___________________________________________________________________________ The display for "SD *" is new; all directory names are shown in full, not truncated to 13 characters; all levels of subdirectories are shown, not just the highest four. Since this may create displays wider than the screen, keys to manipulate the display have been defined. You can also move the cursor onto a directory name, and SD will travel to that directory. Use the HELP key to see what keys can be used in SD *. The display will use the entire defined page size; the full length of terminal emulator windows will be used (up to 99 lines), not just 24 lines (the minimum page size is 18 lines). I have not tested values over 24. When SD * is initially displaying a large directory structure, you can now use the keyboard to move around in the structure while the display construc- tion continues in the background. If you hit BOTTOM or the SPACE bar, the display will again follow the construction in progress. If you are not at bottom when the construction is finished, you will get two beeps to let you know that it is finished. ___________________________________________________________________________ The SDDRAW utility is used to create a printed copy of the tree diagram, or to save a copy of the diagram in a file. If SD * is used from a batch job or a hardcopy terminal, it will invoke SDDRAW to display the diagram. ___________________________________________________________________________ If SD is called with a parameter which contains a Search List logical name, it may work differently from SET DEFAULT. For example, if the following search list is defined: $ DEFINE AZ UDISK2:, UDISK5: then SET DEFAULT AZ:[XXX] goes to AZ:[XXX], but SD will go to UDISKn:[XXX] where n is either 2 or 5, and corresponds to the first of the disks on which directory [XXX] is found. This will not happen if AZ is defined with /TRAN=CONCEALED. I consider this unimportant, since most important Search Lists which I use (such as SYS$SYSROOT) are defined with /TRAN=CONCEALED and SD works as I expect in these cases. I will do more work on this if I get problem reports. ___________________________________________________________________________ SD will now set default to another node, but this has not been tested much or used much by me. ___________________________________________________________________________ The SD * display has finite storage; when this storage overflows, a diag- nostic message is output, and only a portion of the tree structure is displayed. The two limits coded in the program are: 1999 .DIR files, and 1999 lines in the display. The limits may be changed by re-compiling SD.FOR. ___________________________________________________________________________ SD does NOT use the VMS Screen Management package (SMG$); it uses standard VT100 escape sequences and control characters. ___________________________________________________________________________ System Management and Installation Instructions. ------------------------------------------------ The SD command is now fully contained in SD.EXE, except for a small bit in SDTRAVEL.COM which is used only when a directory change requires a .COM file (SDEXIT.COM, SDENTRY.COM, and/or SYS$LOGIN:SD.COM) to be executed. When a privileged user (UIC Group .LE. MAXSYSGROUP) needs to run an SDENTRY.COM or an SDEXIT.COM, it is not done if the command file is owned by a UIC whose group is .GT. MAXSYSGROUP. Other sites may want to change this policy; if so, see SD.MAR. Notes: MAXSYSGROUP is a SYSGEN parameter, with a normal value of 10 octal; SD would consider [10,1] a privileged user, but not [11,1]. If the site changes MAXSYSGROUP, SD uses the site's value. Installation instructions for SD: --------------------------------- 1. Edit SD.MAR; instuctions in it will tell you what to do. 2. Assemble SD.MAR into SD.OBK: $ MACRO SD /OBJ=SD.OBK 3. Link SD.OBJ, SD.OBK, and NXXXLIB.OLB into SD.EXE: $ LINK SD, SD.OBK, NXXXLIB/LIB 4. Transform SD.HLP into SD.HLB, after making necessary local changes (one place may be in subtopic DOCUMENT): $ LIBRARY /HELP /CREATE SD SD 5. Put SD.HLB where you indicated in SD.MAR Put SDTRAVEL.COM where you indicated in SD.MAR Put SD.EXE somewhere; remember where for the next step (6.) 6. Define the SD command verb (usually in SYLOGIN.COM): $ SD == "$dev:[dir]SD " ! Note dollar sign indicating ! "foreign command", and blank ! to left of closing quote. 7. Integrate SD.HLP into your site help library. Note that SD will have HELP in two places: its own SD.HLB, and your site help library. 8. Code from old SD which needs to be done differently: Logical name SD_TRANS is no longer used. Instead of defining global symbols SD__n, where n=0 to 9, you now can define shorthand integers as high as you want, and you do it like: $ SD /0=SYS$DEVICE: /1=UDISK1: . . . which replaces: SD__0 == "SYS$SYSDEVICE:" SD__1 == "UDISK1:" . . . 9. LET has changed to coincide with the new SD. It also is now just an .EXE file; define the command as: $ LET == "$dev:[dir]LET" There is a .HLP file for LET. 10. If SD is invoked as SD /TEST [params], then SD will enter a test mode, which is used to automate quality assurance testing. This currently does: A. If an error occurs, the text of the error message is put in DCL Symbol SD_MESSAGE. The message is also displayed, but not high- lighted and no bells ring as are normally done. This also occurs for SD /VERSION. B. If there is no error, DCL Symbol SD_MESSAGE is set to " ".