.; .; July, 1983. Entire file brought back to RNO format .; for ease of maintenance. .; Oct 20, 1983 Updated to some V6.4 ges .; Nov 09, 1983 Various updates BT .; Jan 16, 1985 Added /AP BT .; Jun 12, 1985 Change to SRDSRT description. BT .; Jan 28, 1997 Added information about four digit years. BQT .; Nov 22, 1999 Changed to version 6.8. BQT .; .;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .PS 60,75 .LM 8 .AP .P 0,1,5 .NHY .HD MIXED # .TITLE ;###SRD - Sorted Directory Utility .ST ;###Version 6.8 22-Nov-99 .FG 20 .C ;SRD - Sorted Directory Utility .C ;============================== .S 6 .C ;User's Guide .C ;============ .S 3 .C ;Version 6.8 .C ;=========== .PG .FG 4 .NJ .HL 1 ^&INTRODUCTION\& SRD is a utility that produces sorted directory listings and performs some useful directory manipulation that is absent from PIP. .X PIP In addition it produces an output file that can be edited by the standard RSX Editor (EDI) [which PIP does not] and provides a wildcard facility in specifying file names so that, for instance, all files beginning with the letters RSX could be listed. SRD has to read the entire directory into memory before sorting it. The size of SRD's buffer can be increased by installing it with an increment. On an RSX-11M system, SRD will try expand itself dynamically. If it cannot fit the entire directory in memory, SRD will give a warning message and do the directory in chunks. Each chunk will be sorted separately. A write-back will be cancelled in this case. .HL 1 ^&INVOKING SRD\& .X INVOKING SRD SRD can be invoked by any of the standard RSX-11M invocation methods, i.e. .s .P 12,0,3 ## RUN $SRD or SRD or SRD command-line .P 0,1,5 In either of the first two cases, SRD prompts for further commands with: .S .P 12,0,3 SRD> .P 0,1,5 A CTRL-Z will terminate SRD in this mode. .HL 2 Indirect command files. SRD will accept an Indirect Command File as input, or SRD may be invoked by an Indirect Command File if it is an installed task. .X Indirect command .HL 1 ^&SRD COMMAND LINE.\& .X COMMAND LINE The format of the command line is similar to PIP's directory operations, i.e. .S .P 12,0,3 SRD>[output filespec=][input filespec][/switches] .P 0,1,5 .HL 2 Output Filespec .X Output .X Filespec Output Filespec defines the output specification for the listing. This may be a file (e.g. DIR.LST), a device (e.g. LP:) or omitted all together, in which case TI:#is used. If any part of the output file specification is omitted that part defaults to the corresponding part of SY:[current UIC]DIRECTORY.LST. The /AP switch may be used to append the listing to an existing file. A later section describes the use of the /AP switch. .X DIRECTORY.LST .X Default output file .HL 2 Input Filespec .X Filespec Input Filespec defines the input specification defining the files on which the switches are to act. SRD can work on a 'partial file specification' basis for each of the filename, extension and version number fields so that: .S .P 12,0,3 SRD SU/LI/WI .P 0,1,5 not only lists out the latest file called SU (as PIP would), but fills in wildcards for any part of the filespec you left out and lists out all files whose filename starts with the two letters SU, for all extensions and all versions. To emphasize this, note that S.M;1/LI/WI would list out all the following: .S .P 12,0,3 S.M;1 SYSTEM.MAC;1 SYS.MAP;1 START.MY;13 and so on. .P 0,1,5 If the Input Filespec is omitted, *.*;* is assumed. Note that the system manager may select certain options and your site may have /WI and/or /LI as defaults. HELP#SRD#SWITCH#DEFAULTS should tell you the default switch settings. .HL 2 Command Line Switches .X Switches .X Command Line Switches Any valid combination of switches described in the next section may be used. (See Switch Combinations.) Defaults for the various switches will be discussed later. These may differ at your site. HELP#SRD#SWITCH#DEFAULTS should tell you the default switch settings. .HL 2 SRD will accept an Indirect Command File as input, or may be invoked by an Indirect Command File. .X Indirect command .TP 10 .HL 1 ^&SRD SWITCHES\& .hl 2 Switch summary .X Quick reference .X Switch summary .NF .NJ /00 - Include [0,0] in wildcarded directory search. /AE - After _& Equal to specified date and time. /AF - AFter specified date and time. /AP - APpend listing to a file. /AT - ATtach output device. /BE - Before _& Equal to specified date and time. /BF - BeFore specified date and time. /BK - BlanK spaces before each file name in list. /CM - CoMmand file format in listing. /CO - Select COntiguous files. /DA - Select file on the DAte specified. /DE - DElete specified files and confirm by listing them. /ER - ERror producing files. /FI - Find file by File Ident without sequence number. /FO - File Owner selection by UIC. /FU - FUll listing of attributes. /GT - Files Greater Than specified blocks allocated. /HD - Echo command line in HeaDer of listing. /HE - HElp. /HV - Higher Version listing - defaults to 2. /ID - IDentify current version of SRD. /LI - LIst. /LO - LOcked files listing. /M2 - Middle listing type 2. /MI - MIddle listing. /MU - MUltiple header files. /NA - NAme sort. /NE - List file Not Equal to specification. /NV - New Version of files, same as /SV /OV - Obsolete Versions. /PA - PAck file listings. Remove blanks. /PU - PUrge. /RD - Revision Date. /SD - Selective Delete. /SE - SElect by wildcard specification. /SI - SIze of SRD's buffer area. /SM - SuMmary lines in listing. /SP - SPool. /SR - Specify SoRt order listing. /SV - Select highest Version - default = 1. /SY - Include SYstem UFD's. /TB - Show Total Blocks used/allocated. /WB - Write Back the directory file. /WD - Wildcard the specification for Delete operations. /WI - WIldcard the specification. /ZE - List files with ZEro blocks used. .s See appendix for some examples. .F .HL 2 Switch Actions .X Switch Actions .X Usage .X Directory Listing .X /LI .HL 3 Produce a Directory Listing (/LI) This just lists the filename, extension and version of the files that meet the specification given. The output is sorted, by default, into the order: .S .P 12,0,3 first Ascending on File Extension then Ascending on File Name then Descending on File Version .P 0,1,5 In addition a header and trailer line are output for each UFD. The header line contains the name of the UFD, the current date and time, and the command line that was originally used. The trailer line contains the number of files selected and the total number of files in the directory. If one of the switches /MI, /FU, /AE, /AF, /BE, /BF, /DA, /CO, /LO, /MU, /ZE, /GT, /ER, /FO, or /TB is specified the .X /AE .X /AF .X /BE .X /BF .X /DA .X /FU .X /MI .X /CO .X /LO .X /MU .X /ZE .X /GT .X /ER .X /FO .X /TB total number of blocks used/allocated for the selected files is also listed. .HL 4 /-LI .X /-LI The /LI switch can be negated to suppress the listing which usually accompanies some of the other switches (e.g. /WB or /PU). .X /WB .X /PU Just the header and trailer lines are printed. .X Middle listing .X /MI .HL 3 'Middle' Directory Listing (/MI[:n], /M2) These switches act similarly to the /LI switch, except that they produce additional information about the selected files. The extra information listed out depends on the setting of the /M2 switch and is either (/M2 .X /M2 not specified): .S .P 12,0,3 Creation Date and Time .X Creation Date .X Revision Date Revision Date and Time Revision Number .s or (/M2 specified): .s Number of Blocks Allocated to File End of File Block Number Contiguous/Locked/Multiheader Flags File ID Creation Date and Time (Revision Date if /RD spec'd) .X File ID .X /RD .P 0,1,5 .HL 3 Produce a Full Directory Listing (/FU[:n]) .X /FU .X Full listing This acts similarly to the /LI switch, except that it lists out yet more information, i.e. .S .P 12,0,3 Number of Blocks allocated to File End of File Block Number Contiguous/Locked/Multiheader Flags File ID Owner UIC Protection Codes Creation Date and Time Revision Date and Time Revision Number .P 0,1,5 If n is specified, it defines the width of the listing (72 to 132). If n is not defined it defaults to the device buffer size. .HL 3 Append listing to a file (/AP) .X /AP .X Append If this switch is specified the generated listing is appended to the specified output file. If the specified output file does not exist or can not be opened (locked or privilege violation), the result depends upon whether a non-zero version number is specified for the listing file. If so, and there is an error opening the file for append, SRD will issue a fatal error message. If no version number is specified (or version zero), and there is an open error, SRD will issue a warning message and then attempt to create a new file version. For convenience /AP may be specified with either the output file specification or input file specification. .X Name sort .X /NA .HL 3 Change the Sort Order (/NA) If this switch is specified the output sort order is altered to be: .S .P 12,0,3 first Ascending on File Name then Ascending on File Extension then Descending on File Version .P 0,1,5 .HL 3 Select Files not Specified (/NE) .X Exclude files .X /NE If this switch is specified then all files that do not meet the given specification are listed out. .HL 3 Select Files by Version Number (/HV[:n]) .X Version .X /HV This switch lists out all files which meet the given specification whose version number is greater than or equal to n. If not specified, n defaults to 2. .HL 3 Latest Versions of Files (/SV[:n] _& /NV[:n]) .X /NV .X Highest versions .X /SV These switches list out the latest n versions of all files that meet the given specification. If not given, n defaults to 1. If n is specified as -1 the oldest version of the selected files are listed. .HL 3 Select Obsolete Versions of Files (/OV:n) .X Obsolete .X /OV This switch restricts the listing of file names to all versions except the "n" highest versions. The default value for "n" is 1. For a given "n", /OV:n lists file names not listed by /SV:n, and the files listed are those that would be deleted if /PU:n were specified. For example, /OV:14/LI would only list files which had more than 14(8) versions and list the lowest versions. As indicated by the definition, if n is -1 then all but the oldest version are listed out. .HL 3 Select Files by Date (/AE,/AF,/BE,/BF,/DA) .X Date .X /AE .X /AF .X /BE .X /BF .X /DA Each of these switches takes an optional date and/or time as parameter, in the form dd-mmm-yy(yy) hh:mm, or hh:mm dd-mmm-yy(yy), etc. e.g.: /DA:03-DEC-83 10:30 In fact the date may be specified as ddmmmyy(yy) if desired: /DA:3DEC83 10:30 If no date is specified, today's date is assumed. If no time is specified, time checks are ignored. .LIST .LE;/AE lists all files created on or after the given date (and time). .LE;/AF lists all files created after (but not on) the given date (and time). .LE;/BE lists all files created on or before the given date (and time). .LE;/BF lists all files created before (but not on) the given date (and time). .LE;/DA lists all files created on the given date (and time). .ELS For these switches the listing includes the creation date and time. If the /RD switch is specified then the Revision Date is used for the checks and the listing includes the Revision Date and Time. .HL 3 Use wildcards in filename (/SE:filespec) .X Wildcards .X /SE Because of the parsing structure in RSX (before V4.0 _& V2.0M+), it was impossible to have wildcards for letters in the Input Filespec, and so this switch was included to allow the facility. .note If your system is RSX-11M V4.0 or RSX-11M+ V2.0 or a higher version of these systems, the /SE switch is only necessary if you want to wildcard the file version field. .end note The filespec argument it takes is identical to that defining the Input Filespec with the following additional features: .S .P 12,0,3 % (or ?) matches one wildcard character. * matches any number (including zero) of wildcard characters. .P 0,1,5 Any combination of these characters may be used in any of the filename, extension or version number fields. Note that within each field, if an * is specified somewhere, and the final character is not an * then that final character is assumed to be required as the last character of the field. "*D" will match FRED but not FREDA and "*D*" will match both FRED and FREDA. Suppose we have the files: .s FRED, FREDA, FREDERIK, FEED, FILD, FEEDER, FRIED, FD .s then .s /SE:F%%D* will match FRED, FREDA, FREDERIK, FEED, FILD,FEEDER .s /SE:F%%D will match FRED, FEED, FILD .s /SE:F*D will match FRED, FEED, FILD, FRIED, FD .s /SE:F*D* will match everything. Note that /SE cannot be used in combination with a standard Input Filespec. .X /SE .HL 3 List by file ID (/FI:n) .X /ID .X File ID This switch will list a file with the specified identification number. A handy switch when you have an error message which doesn't tell the file name but gives the ID. Note that only the file identification number should be specified, not the sequence number. .HL 3 File owner (/FO:[ggg,mmm]) List files by the owner of the file or if negated all files not owned by the specified UIC. Either of the UIC fields may be wildcarded, e.g., /FO:[*,54] for all files owned by any group number and a member number of 54(8). .X File owner .X /FO .X UIC the form "/-FO" will list all the files in the current UFD not owned by the current UIC. An alternate form of this switch is supported for compatibility. "/FO:g:m" is valid. .HL 3 Selection by block size (/GT:n) .x /GT .X Block size .X Allocation This switch list files which have at least n blocks allocated. It is very useful for locating where all the storage has gone! .HL 3 Blocks used/allocated (/TB) .x /TB .X Total blocks This will ensure that SRD summarizes the blocks used and allocated for the selected files. .HL 3 Delete Files (/DE) .X Delete .X /DE This switch deletes all files which meet the given specification and lists the deleted files for confirmation. .HL 3 Purge the directory (/PU:n) .X Purge files .X /PU This switches purges all but the highest n versions of all files meeting the Input File Specification and lists those purged. If not specified, n defaults to 1. If n is -1 then all but the oldest version of the specified files are purged. .HL 3 Selectively Delete Files (/SD:filespec) .X /SD .X Selective delete This switch lists all the files that meet the given specification, and SRD prompts the user to see if the file should be deleted. There are five allowable replies: .S .P 12,0,3 Y = Delete this file N = Do Not Delete This File G = Delete the rest of the specified files Q = Exit without deleting any more files CTRL-Z = Terminate selective delete sequence. .P 0,1,5 Any other response is interpreted as "N" (NO). If "G" (GO) is entered, the question "ARE YOU SURE?" is asked to be certain you wish to delete the remaining files. The filespec, if given, follows the same rules as for /SE. .HL 3 Write Back the Directory File (/WB) .X Write back .X Rewrite directory .X /WB If this switch is specified then as well as producing a listing, SRD writes the file headers back to the UFD in the order of the listing. This means both that the UFD is compressed (which could speed up FCS operations) and that future PIP operations will proceed in the sorted order given. A particularly useful application of this is .S .P 12,0,3 SRD [0,0]/WB or SRD [0,0]/WB/NA .P 0,1,5 which will sort the UFD files, so that SRD [*,*]/LI will then list files in numeric order of directories as well as sorted on filename, etc. Write Access to the directory is required and Write Failure is usually due to a protection violation. In the event of a write-back failure, the operation is attempted several times. .HL 3 Use Revision Date (/RD) .X Revision Date .X /RD On the date selection, use the revision date (if any). In addition, if this is used for a /MI (/M2) listing the Revision .X /M2 .X /MI Date will be listed instead of the Creation Date. This switch is installation selectable and may have a default set by your system manager. .HL 3 Sort the Directory (/SR) .X Sort .X Sort keys .X Keys .X /SR[:key1...] .X Output Sort the file names. This option is turned off if the files are not being listed or written back. You can also say /-SR to get .X No sort .X /-SR the files listed in the order they are in the directory. This is the same order that PIP lists them. Using the key arguments on the /SR switch specifies the order in which SRD will sort the files. The key argument consists of one or two characters. The first character specifies the field of the file specification on which to sort and the second character specifies the sort order, ascending or descending. The file specification field characters are: .P 12,0,3 N - file name T - file type V - file version D - file date .P 0,1,5 The second character is either an A or a D for Ascending or Descending SRD's default sorting order is: .ls 0 .LE;Ascending by file type .LE;Ascending by file name .LE;Descending by version number .ELS This default sorting order is specified by /SR:T:N:VD or /SR:TA:NA:VD. If any or all or the optional key arguments are omitted the default order is used. .HL 3 Include System UFD's in Wildcard Searches (/SY) .X System UFD's .X /SY If this switch is specified then all system UFD's (i.e. those with a group code between 0 and 10 inclusive) will be included in [*,*] or [*,n] searches. If it is switched off (/-SY) then such UFD's will be ignored. This switch (or it's negation) has no effect unless the group code of the specified UFD is wild. This switch is installation dependent and may have a default set by your system manager. .HL 3 Include [0,0] in Wildcard Searches (/00) .X /00 .X MFD If this switch is specified then [0,0] will be included in [*,*], [0,*] or [*,0] searches. If the switch is negated (/-00) then the [0,0] directory will be ignored during the search. Directory [0,0] can always be listed by specifying it directly. .X System UFD's .HL 3 Treat all specifications as 'wildcarded' (/WI, /WD) .X Wildcards .X /WI .X /WD One of the great powers of SRD is the ability to specify just, say, S as a filename and get a listing of all files with a filename beginning with S. It is, however, also desirable at times to be able to specify that you want only files with a filename of S on its own. The switch /WI controls this with 'implicit wildcarding' assumed if it is specified, but not if it is negated (see /SE for an example). In addition /WD specifies whether the 'implicit wildcarding' indicated by /WI also applies during delete/purge operations (yes if specified, no if negated). Both are ignored if /SE or /SD is given. .NOTE If /-WI is specified, "FRED" will still be read as FRED.*, but "FRED." will only look for files with a file name of FRED and with a null extension. .END NOTE .HL 3 Select only Contiguous Files (/CO) .X Contiguous .X /CO This switch causes SRD to select only files which are contiguous. .HL 3 Select only Locked Files (/LO) .X Locked Files .X /LO This switch causes SRD to list only files which are locked. .HL 3 Select only Zero-Blocks-Used Files (/ZE) .X Zero-Length Files .X /ZE This switch causes SRD to list only files which have zero blocks used. .HL 3 Select only Multi-Header Files (/MU) .X /MU .X Multi-Header Files This switch causes SRD to list only files which have multiple headers. .HL 3 Print out the current Version of SRD (/ID) .X SRD version .X /ID This option will display the current version of SRD. .HL 3 Print out the available Buffer Size (/SI) .X /SI .X Buffer Size (/SI) This option will display the size of SRD's buffer which it uses to read the directory files into memory. This switch is for diagnostic purposes only, and can be used to determine how large a directory file can be processed by SRD. .HL 3 Attach output device if terminal (/AT) .X Attach terminal .X /AT .X Output If this switch is specified then the output device (if it is a terminal) will be attached during the operation. This has the advantage of allowing CTRL-O to be used to suppress any listing, and the disadvantage of tying up the terminal during what could be a long search. If the switch is negated (-/AT) the terminal will not be attached. This switch is installation dependent and may have a default set by your system manager. .HL 3 Give brief help (/HE) .X /HE .X Help Typing /HE will print out a brief summary of the SRD switches. For this to function properly, the HELP facility must be present on your system. /HE will cause a command "HELP SRD" to be issued to the operating system. .HL 3 Spool the Output File (/SP) .X /SP .X Spool files If this switch is specified then the output file (if one was specified) is spooled to the Print Spooler (PRT...). In addition, if a multiple-UIC search is being done, SRD inserts a form feed before each new UIC. .HL 3 Command file format (/CM:xxx:fffff) .X Output .X /CM .X Indirect command .X File format This switch is used to generate an indirect command file which will invoke a processor such as a compiler. For each file selected by the SRD command line, SRD's output file may contain a line like: .s xxx outfile,listfile=infile.typ;ver,infile .S The field "xxx" represents the processor name, as specified by the first /CM switch argument. The "outfile", "listfile", and "infile" are all made from the selected file name for each file selected. The second switch value controls the actual format of the output line. This switch value can contain any of the letters "O", "L", "T", "V", and "S", in any order. The meaning of these letters is as follows: .S .nf .nj .lm +3 letter meaning O provide "outfile" field L provide "listfile" field T provide type for first "infile" V provide version number in first "infile" field S provide second "infile" field (always with version ";0") .F .LM -3 If the second switch value is not specified, then the default form for each output line is "infile" only. For example, if a user account contains only the files MAIN.MAC;10, SUB1.MAC;7, SUB2.MAC;2, SUB2.MAC;3, and SUB3.FOR;6, then the command .S >SRD MAINBLD.CMD=/SV/CM:MAC .S would produce file MAINBLD.CMD containing only the lines .NF .LM +3 MAC MAIN MAC SUB1 MAC SUB2 MAC SUB3 .S and the command .S >SRD SUBASM.CMD=S*.MAC/SV/CM::TVLO .S produces SUBASM.CMD containing: .s SUB1,SUB1=SUB1.MAC;7 SUB2,SUB2=SUB2.MAC;3 .s .lm -3 .f Any string not containing "/", ":", or "=" can be used for the processor name argument or it may be null. Note that if /NV (or /SV) is not specified then the "V" should be used in the second switch value to avoid duplicate lines. The /PA switch is implicit in the /CM switch. .HL 3 Print command line in header (/HD) .X Header .X COMMAND LINE .X /HD This switch causes SRD to print the command line issued in the header following the line showing the UIC. The command echoed in the header is the line the user typed before any wildcard substitutions were made. This switch may be negated to suppress the command line echo. This switch is installation dependent and may have a default set by your system manager. .HL 3 Print summary lines (/SM) .X Summary lines .X /SM This switch causes SRD to print a summary line following the files listed for each directory stating the number of files selected and the total number of files in the directory. If switch /FU, /MI, /DA, /AF, /AE, /BF, /BE, /CO, /LO, /MU, /ZE, /GT, /ER, /FO, or /TB is specified, then an additional summary line will give the number of blocks used and allocated for the files selected. This switch is installation dependent and may have a default set by your system manager. .HL 3 Place two spaces before each file name (/BK) .X Two spaces .X /BK This switch causes SRD to insert two blank characters ahead of the file name on each file listing line. (Some widely used previous versions of SRD inserted these two blanks, while others did not. This switch gives you a choice.) This switch is installation dependent and may have a default set by your system manager. .X Output .HL 3 Pack file listings (/PA) .X /PA .X Spaces .X Blanks The pack switch removes all spaces from the file listing. FILE#####.Q##;21 becomes FILE.Q;21. .HL 2 Switch Combinations .X Switch Combinations All switch combinations work as would seem logical. For example, .X Combining switches .S .P 12,0,3 SRD /AF:7-DEC-83 10:30/BE:7-DEC-83 14:44 .P 0,1,5 would list out all files created on 7th December 1983 between 10:30 and 14:44. .S .P 12,0,3 SRD *.*/PU/SD .P 0,1,5 will list out the files to be purged and allow you to selectively delete them. .HL 3 Restrictions to Switch Combinations .X Restrictions .LS .LE;/DA cannot be used with /AE, /AF, /BE or /BF. .X /DA .LE;/DE cannot be used without /SE or a file name specified. .X /DE .LE;Only one of /NV, /SV, /OV, /PU may be used at once. .X /SV .X /PU .X /OV .LE;Only one of /LI, /MI, /FU should be used at once. SRD will use the switch requesting the most listing information. .X /MI .X /FU .LE;/ID, /SI and /HE cannot be used with other switches. .X /ID .X /HE .X /SI .LE;And other nonsensical combinations (like /NA/-SR). .LE;It is not meaningful to negate the switches /NE, /HV, /SV, /OV, /AE, /AF, /BE, /BF, /DA, /SE, /PU, /SD, /ID, /SI and /HE. .ELS .HL 2 Switch Defaults .X Switch Defaults Default values for the switches are set at Task-Build time, and may vary from installation to installation. Any of the switches may be preset in this way, but usually the only ones affected are /LI, /NA, /RD, /SR, /SY, /AT, /00, /WI, /WD, /M2, /HD, /SM, and /BK. HELP#SRD#SWITCH#DEFAULTS or HELP#SRD#DEFAULTS should display a list of the switch defaults at your site. .HL 1 ^&ERROR MESSAGES\& .X Error messages .LIST .S .LE;SRD#--#Directory too big. Doing in pieces. SRD was unable to expand its buffer sufficiently to hold the whole directory at once. .S .LE;SRD#--#Command read error Either an error occurred in reading the command line, or a comma was specified other than in the UIC of the Input or Output Filespec. .S .LE;SRD#--#Command syntax error The command line failed to parse correctly, and is therefore invalid. .S .LE;SRD#--#Error in input spec An invalid input filespec was given. .S .LE;SRD#--#Error in output spec An invalid output filespec was given. .S .LE;SRD#--#Error reading MFD An error occurred while SRD was trying to read the Master File Directory. .S .LE;SRD#--#Parse error The output filespec could not be parsed correctly. .S .LE;SRD#--#Open error on input SRD detected an error opening an input file. .S .LE;SRD#--#Open error on output SRD detected an error opening the output file. .S .LE;SRD#--#Directory find error A directory was specified which does not exist. .S .LE;SRD#--#No such file(s) No files were found to match the input specification. .S .LE;SRD#--#Invalid date format. Enter DD-MMM-YY(YY) HH:MM (1-SEP-83 10:30) Dates must be entered in the form DD-MMM-YY(YY) HH:MM (or vice versa) or DDMMMYY(YY) HH:MM (or vice versa) with the single exception that the date may be abbreviated to one character. .S .LE;SRD#--#Error reading file header for [g,m]name.typ;ver SRD detected an error while trying to read a file header. .S .LE;SRD#--#Put error An error occurred while trying to output a record to the output device. .S .LE;SRD#--#Write error An error occurred while trying to write back a directory. .S .LE;SRD#--#Read error An error occurred while trying to read a directory. .S .LE;SRD#--#Error deleting file An error occurred while trying to delete a file. .S .LE;SRD#--#Directory privilege violation The user does not have the required read or write access to the given directory. .S .LE;SRD#--#Directory open error An error occurred while trying to open a directory file. .S .LE;SRD#--#Directory write-back error for [g,m] An error occurred while trying to write a directory back into the directory file. .S .LE;SRD#--#Write-back cancelled. Can't fit entire directory in memory: [g,m] A write back was requested (/WB) but cannot be performed as the directory has only been sorted in chunks. .S .LE;SRD#--#File ID-Sequence number mis-match for [g,m]name.typ;ver An attempt to read a file header failed because of a file ID and sequence number mismatch. .S .LE;SRD#--#Header-read privilege violation for [g,m]name.typ;ver The user did not have valid access rights to read the file header for the specified file. .;.S .;.LE;SRD#--#Open error .;.S .;.LE;SRD#--#Get error .S .LE;SRD#--#File date corrupt in file header for [g,m]name.typ;ver The date stored in the file header is corrupt. .S .LE;SRD#--#Error reading extension header -- SRD detected an error while trying to read an extension file header. .S .LE;SRD#--#Invalid or duplicate /SR:#sort key values The sort key values may not be repeated. The valid keys are T (file type), N (file name), V (file version), and D (file date). Examples: /SR:N:T:V (all ascending); /SR:N:DD (name ascending, date descending). .S .LE;SRD#--#Sort key combination invalid for /SV, /NV, /OV, /PU In order to get version selection, name and type must be the first two sort keys (either order), and version must be the third sort key. .S .LE;SRD#--#Some file dates can not be read for sort by date Dates in some file headers are corrupt. If these files are selected for listing, they will be listed first. .S .LE;SRD#--#Char.#other than O,L,T,V,S found in /CM switch - ignored The only options accepted in the second /CM switch value are O, L, T, V, and S. .S .LE;SRD#--#Unable to open specified output file for append The output file specification included a specific version number. The file did not exist or could not be opened for append (for example, file locked or file protection violation). .S .LE;SRD#--#Output file append error - attempting to open new file version The output file specification was for a highest version. The file did not exist or could not be opened for append (for example, file locked or file protection violation). SRD will create a new file version if possible. .END LIST .;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .; .; THIS WOULD BE A GOOD PLACE TO CUT THIS FILE IF NO SYS INFO .; IS WANTED IN THE MANUAL. END OF THIS SECTION IS MARKED .; WITH A COMMENT LINE OF PLUS SIGNS .;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .PAGE .HL 1 ^&SRD SYSTEM MANAGER'S GUIDE\& .X System manager .HL 2 Task Structure .X Task Structure SRD consists of fifteen modules, in the following structure: .X Modules .; .; Following chart is LITERAL .; .s 2 .lit SRDROT ! SRDATA ! SRDSUB ! SRDTRP ! ----------------------------------------------------------- ! ! ! ! ! ! SRDINI SRDNUD SRDOPR SRDSRT SRDDBF SRDLST ! ! ! ! SRDREP SRDXX1 SRDXX2 SRDTST ! SRDXX3 .END LITERAL .; .; .; (Note that some routines from SYSLIB are also overlaid). .X SYSLIB .HL 3 SRDROT .X SRDROT SRDROT is the high-level module that controls all the others. It first calculates the top of the re-usable task space (see write-up on SRDXXn) and the minimum size of buffer required (the difference between that and the top of the code). It then calls SRDINI to get a command. If the request was /ID it outputs the .X /ID Version Number message and returns to call SRDINI for another input line. If the request was /SI it calls SRDDBF to calculate .X /SI the current buffer size and returns to call SRDINI for another input line. In all other cases it calls SRDOPR and SRDSRT to access each directory, SRDLST to output any listing and SRDNUD to access the next UIC (if a wildcard was specified). It is also responsible for spooling the output file if required. .HL 3 SRDATA .X SRDATA SRDATA merely contains all the global data used by the task. .HL 3 SRDSUB .X SRDSUB SRDSUB contains four commonly used subroutines: .LIST .LE;ATTDET - which attaches to or detaches from a given device. .X ATTDET .LE;CNVDAT - which converts an ASCII date and time into an internal .X CNVDAT format. Note that CNVDAT has two subsidiary entry points (CVDATE and CVTIME) if only the date or time on their .X CVTIME .X CVDATE own are to be converted. .LE;SRDCOM - which compresses a directory in the input buffer .X SRDCOM .LE;ALERR - which is called by various routines (including $AUTO) .X ALERR when an Executive Directive fails. Currently it simply puts the return address in R0 and the contents of the DSW in R1 and issues a HALT (which will terminate the program with a register dump) but should really be made rather more intelligent. .ELS .HL 3 SRDTRP .X SRDTRP All errors are logged by executing a TRAP instruction. These are trapped by SRDTRP which formats and outputs the relevant error message and then exits. While very easy to implement this is a rather noddy method of error reporting and should really be improved. .HL 3 SRDINI .X SRDINI SRDINI first shrinks the task back to its basic size (this is not really necessary as SRDOPR will do it if necessary). It then sets the default values for the switch masks, zeroes all the valid data areas and gets the next command line from the user (via GCML$), calls SRDREP to replace any illegal characters and then parses it via CSI. If the user requested help (/HE) it supplies .X /HE it (via a spawn to MCR) and prompts for another line. It opens the output file (if any were given), interprets and sets up dates for the /DA, /AE, /AF, /BE and /BF switches and then sets up the .X /DA .X /AE .X /BE filename block for the (first) required directory. .HL 3 SRDREP .X SRDREP SRDREP simply checks the command string for characters that CSI will object to, and replaces them. Otherwise, expressions like: .S 1 .P 12,0,3 ## SRD /DA:10:30 or SRD /SE:;1 .X /SE .P 0,1,5 would be truncated. .HL 3 SRDOPR .X SRDOPR SRDOPR opens the current directory file, unless it is already open, and finds out how large it is (or how much more there is to be read into memory). It then attempts to extend/contract SRD until the buffer is the same size as that required for the directory (or what remains of it). [Note that it must ensure that SRD maintains at least the minimum buffer calculated in SRDROT, or the next attempt to load in the SRDINI overlay will fail.] If that fails it merely extends SRD as far as it can. It then attempts to read in as much of the directory as it has found room for. It then compresses the buffer and, if more directory was needed, tries to read in some more until it either has all of the directory in memory, or can compress the existing buffer no further. .HL 3 SRDSRT .X SRDSRT SRDSRT first compresses the directory, by moving the entries up over unused slots. It then sorts the entire directory (by using a modified Shell sort followed by a shuttle sort). If /WB was specified and the whole directory is .X /WB in memory, it is written back into the directory file. .HL 3 SRDNUD .X SRDNUD SRDNUD reads the MFD to find the next directory that matches the wildcard search requested. .HL 3 SRDLST .X SRDLST SRDLST examines each entry in the directory in the buffer in turn. First it checks the version number, if /HV was specified. .X /HV If that qualifies, it converts the directory name to ASCII in the output buffer and, if a filename was specified (directly or via /SE or /SD), calls SRDTST to check it. If the match fails and /NE .X /SE was not specified (or vice versa) the name is ignored. Otherwise it checks the current (and adjacent) version to see if the filename qualifies under any /SV, /OV or /PU switches. If it .X /SV does, it checks to see if it qualifies under any /CO, /LO or /MU .X /LO switches. If that matches it checks to see if it qualifies under any /AE, /AF, /BE, /BF or /DA switches. Once it has been determined that the given file specification matches that requested, the module formats the output line(s) according to the type of listing requested. If /SD was specified it then prompts the user to see if he wants the file deleted. If /DE or /PU was specified, or /SD and the user answered Y this time, or G previously, the file is deleted. The routine then returns to check the next entry. When all the entries have been checked the routine outputs the trailer line for the directory. .HL 3 SRDTST .X SRDTST SRDTST checks an individual filename to see if it matches up to the selection criteria laid down by a specified input filename, or a /SE switch (q.v.). .HL 3 SRDDBF .X SRDDBF SRDDBF merely calculates the amount of space in the buffer and outputs a message accordingly. .HL 3 SRDXX1/2/3 .X SRDXX1/2/3 SRDXX1, SRDXX2 and SRDXX3 are used to enable SRD to reclaim some space. Each defines a PSECT that will follow all others in a segment ($$$XXn) and a global symbol to locate that PSECT (XXn). One is attached at the end of each of the three longest segments, not counting SRDINI. The idea is that once SRDINI (which is the longest path in the task) has parsed the command line, the later modules can reclaim the extra space it required as buffer space, and they do this by SRDROT working out from the SRDXXn modules, segment (of the others) ends. This is a potentially tricky method, but appears to work at the moment in overlaid or non-overlaid versions of SRD. If SRD starts crashing with errors from $AUTO it is probably something to do with these. .HL 3 SRDSYS/SRDPRE .X SRDSYS .X SRDPRE These are two prefix files used in assembling the SRD modules. SRDSYS simply contains the system-specific definitions (such as Operating System, existence of EIS and such-like) and is created by SRD.CMD. SRDPRE contains definitions of all the local symbols (such as the switch bit settings) and macros used in SRD. .HL 2 Assembling and Building SRD .X Building SRD SRD is assembled and built by means of the command file SRD.CMD. On the first time through SRD.CMD it will ask questions relating to what system you are running on (to create SRDSYS.MAC) and to what default switch settings you want for SRD (and will create SRD.BLD and SRD.ODL). In future invocations you can use these files without having to create new copies each time. SRD is a non-privileged task, with 5 units and a task name of ...SRD. It should be task-built with the following options: .S 1 .P 12,0,3 TSKV####=SSTVC$:7 STACK###=128 ASG#####=TI:1 ASG#####=SY:2:3:4 ASG#####=TI:5 UNITS###=5 GBLDEF##=..RWLG:1 GBLDEF##=SWINI:n GBLDEF##=SW2INI:n GBLDEF##=SW3INI:n TASK####=...SRD .P 0,1,5 .HL 3 SWINI .X SWINI defines the initial switch settings of the first mask: .S 1 .P 12,0,3 #####2 = /LI - List the directory 100000 = /NA - Sort by Name first .P 0,1,5 .HL 3 SW2INI .X SW2INI defines the initial switch settings of the second mask: .S 1 .P 12,0,3 ####40 = /RD - Use Revision Date for date checks ###100 = /SR - Sort the directory ###400 = /SY - Include system accounts in [*,*] ##1000 = /AT - Attach output device if terminal #10000 = /WD - Implicit wildcarding in delete #20000 = /WI - Implicit wildcarding in listing 100000 = /M2 - Type 2 Middle Size Listing .HL 3 SW3INI .X SW3INI defines the initial switch settings of the third mask: .S 1 .P 12,0,3 #####1 = /00 - Include [0,0] in [*,*] #####2 = /SM - Include summary lines in listing #####4 = /HD - Include command line in listing ####10 = /BK - Put in 2 blanks ahead of file names .P 0,1,5 .HL 2 SRD RSX-11M Overlay .X Overlay The overlay used currently except for RSX-11M V4/FCSRES is: (Check the ODL file if FCSRES used in versions prior to V4, some SYSLIB references are deleted from the ODL below) .S 1 .NF .LM -8 .NJ .NAP .NAME OV1INI .NAME OPNFNB .NAME PRSFNB .NAME CSI12 .ROOT SRDR-*(O1,O2A,O2B,O2C,O4,O5) SRDR: .FCTR SRDROT-SRDATA-SRDSUB-SRDTRP-LIBR LIBR: .FCTR LB:[1,1]SYSLIB/LB:ASSLUN:ARITH:CBTA:DIRECT:DEL:EOFCHK-LIBR2 LIBR2: .FCTR LB:[1,1]SYSLIB/LB:MKDL:MOVREC:PGCS:RDWAIT:RETADR:WATSET O1: .FCTR SRDINI-SRDREP-*(O11) O2A: .FCTR SRDNUD O2B: .FCTR SRDOPR-SRDXX1 O2C: .FCTR SRDSRT-SRDXX2 O5: .FCTR SRDDBF O4: .FCTR SRDLST-SRDTST-LB:[1,1]SYSLIB/LB:PUTSQ-SRDXX3 O11: .FCTR OV1INI-*(OP1,PRS1,CSI1) OP1: .FCTR OPNFNB-LB:[1,1]SYSLIB/LB:OPFNB:$PRINT PRS1: .FCTR PRSFNB-LB:[1,1]SYSLIB/LB:PARSE CSI1: .FCTR CSI12-LB:[1,1]SYSLIB/LB:.CSI1:.CSI2 .END .F .HL 3 SRD RSX-11M FCSRES Overlay .X FCSRES The overlay used on RSX-11M mapped Version 4.0 with FCSRES is: .S 1 .NF .NJ .ROOT OSRDR-*(O1,O2A,O2B,O2C,O4,O5) SRDR: .FCTR SRDROT-SRDATA-SRDSUB-SRDTRP O1: .FCTR SRDINI-SRDREP O2A: .FCTR SRDNUD O2B: .FCTR SRDOPR-SRDXX1 O2C: .FCTR SRDSRT-SRDXX2 O4: .FCTR SRDLST-SRDTST-SRDXX3 O5: .FCTR SRDDBF .END .F .LM +8 .AP .;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .; .; END OF SYS INFO SECTION .; .;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .; .; .;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .AX EXAMPLES ALL examples are from the same directory. The first example shows the directory as PIP would list it. The /-SR switch tells SRD not to sort the directory. .NAP .LM -7 .NF .NJ .S 2 .TP 10 ** DR2:[352,352] 20-OCT-83 01:45 >SRD /LI/-SR SAVIT .CMD;1 CASHFLOW .FTN;13 CHAR170 .SEQ;1 C .FTN;27 EBCDIC .B2S;3 EDTINI .EDT;1 FIXUIC .PRO;22 LOGIN .CMD;3 MTDRV .MAC;2 QFORMS .CMD;34 CALC .FTN;1 REPAIR .PRO;13 TOOLS .CMD;14 TVI .CMD;2 CASHFLOW .CMD;5 .S 2 .TP 10 ** DR2:[352,352] 20-OCT-83 01:45 >SRD *.CMD/MI CASHFLOW .CMD;5 17-MAY-83 13:46 20-OCT-83 01:02 (2.) LOGIN .CMD;3 19-MAY-83 19:14 20-OCT-83 01:02 (2.) QFORMS .CMD;34 21-JUL-83 11:50 20-OCT-83 01:02 (2.) SAVIT .CMD;1 09-JUL-83 19:24 20-OCT-83 01:02 (2.) TOOLS .CMD;14 08-AUG-83 11:19 20-OCT-83 01:02 (2.) TVI .CMD;2 29-JUL-83 07:41 20-OCT-83 01:02 (2.) .S 2 .TP 10 ** DR2:[352,352] 20-OCT-83 01:45 >SRD /NA C .FTN;27 CALC .FTN;1 CASHFLOW .CMD;5 CASHFLOW .FTN;13 CHAR170 .SEQ;1 EBCDIC .B2S;3 EDTINI .EDT;1 FIXUIC .PRO;22 LOGIN .CMD;3 MTDRV .MAC;2 QFORMS .CMD;34 REPAIR .PRO;13 SAVIT .CMD;1 TOOLS .CMD;14 TVI .CMD;2 .S 2 .TP 10 (EXCLUDE all .CMD files and sort by name) ** DR2:[352,352] 20-OCT-83 01:45 >SRD *.CMD/NA/NE C .FTN;27 CALC .FTN;1 CASHFLOW .FTN;13 CHAR170 .SEQ;1 EBCDIC .B2S;3 EDTINI .EDT;1 FIXUIC .PRO;22 MTDRV .MAC;2 REPAIR .PRO;13 .S 2 .X Output .TP 10 (All files starting with "C" and sort them by version in descending order.) ** DR2:[352,352] 20-OCT-83 01:45 >SRD C*./SR:VD C .FTN;27 CASHFLOW .FTN;13 CASHFLOW .CMD;5 CALC .FTN;1 CHAR170 .SEQ;1 .S 2 .TP 10 (Full listing of all files starting with "CA" then any two characters and any type. Must have four character file name.) ** DR2:[352,352] 20-OCT-83 01:45 >SRD /SE:CA%%.*/FU CALC .FTN;1 13./13. [352,352] (14152,3) [RWED,RWED,RWED,R] 17-MAY-83 13:46 20-OCT-83 01:02 (2.) .S 2 .TP 10 ** DR2:[352,352] 20-OCT-83 01:45 >SRD /SE:*OW.* CASHFLOW .CMD;5 CASHFLOW .FTN;13 .F .J .AP .LM +7 .;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .; END OF EXAMPLES .; .LM +12 .PAGE .t SRD V6.8 INDEX .PRINT INDEX SORTED DIRECTORY UTILITY