SRD - Sorted Directory Utility ============================== SRD is a very powerful utility for listing selected parts of one or more directories. It takes combinations of the following switches:- /AE - Files After/On Given Date /AF - Files After Given Date /AT - Attach Output Device /BE - Files Before/On Given Date /BF - Files Before Given Date /CO - Contiguous Files /DA - Files on Given Date /DE - Delete Files /FU - Full Listing /HV - Versions over given number /ID - Current Version Number /LI - Brief Listing /LO - Locked Files /MI - Middle Listing /MU - Multi-Header Files /M2 - Type 2 Middle Listing /NA - Sort in Name Order /NE - Exclude specified files /OV - Obsolete Versions /PU - Purge certain versions /RD - Use Revision Date /SD - Selectively Delete /SE - Select with wildcards /SI - Current Buffer Size /SM - Print summary of no. files /SP - Spool Output File /SR - Sort the Listing /SV - Select Latest Versions /SY - Include System Accounts /WB - Write back Sorted Directory /WD - Implicit Wildcarding for Delete /WI - Implicit Wildcarding /00 - Include [0,0] /ZE - List Zero Length Files /HD - Include SRD command line on list /BK - Include 2 blanks before filename For help on a given switch type HELP SRD For help on switch defaults type HELP SRD SWITCH DEFAULTS 2 /HD Include SRD command line on listing This command copies the SRD command line onto the SRD output listing immediately after printing the directory number. 2 /SM Produce a Summary Listing This lists the number of files selected and total in the directory examined. If file headers were examined, total numbers of blocks used/allocated are also printed. 2 /LI Produce a Directory Listing (/LI:n) 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:- Ascending on File Extension then Ascending on File Name then Descending on File Version 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 or /DA is specified the total number of blocks used/allocated (for those files selected) is also listed. This switch can be negated and used to suppress the listing that usually accompanies some of the other switches (e.g. /WB or /PU) - in which case just the header and trailer lines are printed. If n is specified, it defines the width of the listing (72 to 132) - if not it defaults to the device buffer size. 2 /MI #M2 2 /M2 Produce a 'Middle' Directory Listing (/MI:n, /M2) This acts similarly to the /LI switch, except that it lists out more information. The extra information listed out depends on the setting of the /M2 switch and is either (/M2 not specified):- Creation Date and Time Revision Date and Time Revision Number or (/M2 specified):- 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 specified) 2 /FU Produce a Full Directory Listing (/FU:n) This acts similarly to the /LI switch, except that it lists out yet more information, i.e. 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 Note that while a file is being created SRD will list the blocks allocated as 0, rather than the value PIP produces, because the header is not yet set up properly. n, if specified, has the 2 /NA Change the Sort Order (/NA) If this switch is specified the output sort order is altered to be:- Ascending on File Name then Ascending on File Extension then Descending on File Version 2 /NE Select Files not Specified (/NE) If this switch is specified then all files that do not meet the given specification are listed out. 2 /HV Select Files by Version Number (/HV:n) 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. 2 /SV Select Most Recent Versions of Files (/SV:n) This switch lists out the latest n versions of all files that meet the given specification. If not given, n defaults to 1. If n is -1 then this lists out the oldest version of the file. 2 /OV Select Obsolete Versions of Files (/OV:n) 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. As indicated by the definition, if n is -1 then all but the oldest version are listed out. 2 /AE #DA 2 /AF #DA 2 /BE #DA 2 /BF #DA 2 /DA Select Files by Date (/AE,/AF,/BE,/BF,/DA) Each of these switches takes an optional date and/or time as parameter, in the form dd-mmm-yy hh:mm, or hh:mm dd-mmm-yy, etc. e.g.: /DA: 03-DEC-79 10:30 (In fact the date may be specified as ddmmmyy if desired). If no date is specified, today's date is assumed. If no time is specified, time checks are ignored. Then /AE lists all files created on or after the given date (and time). /AF lists all files created after (but not on) the given date (and time). /BE lists all files created on or before the given date (and time). /BE lists all files created before (but not on) the given date (and time). /DA lists all files created on the given date (and time). 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. 2 /SE Use wildcards in filename (/SE:filespec) Because of the parsing structure in RSX, it is impossible to have wildcards for letters in the Input Filespec, and so this switch is included to allow the facility. The filespec argument it takes is identical to that defining the Input Filespec with the following additional features:- (i) % (or ?) matches one wildcard character. (ii) * matches any number (including zero) of wildcard characters. 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. (e.g. *D will match FRED but not FREDA *D* will match either). Example: Suppose we have the files:- FRED, FREDA, FREDERIK, FEED, FILD, FEEDER, FRIED, FD then /SE:F%%D will match FRED, FREDA, FREDERIK, FEED, FILD,FEEDER (if /WI specified) /SE:F%%D< will match FRED, FEED, FILD (if /WI not specified) /SE:F*D will match FRED, FEED, FILD, FRIED, FD /SE:F*D* will match everything. (Note that /SE cannot be used in combination with a standard Input Filespec). 2 /DE Delete Files (/DE) This switch deletes (and lists) all files that meet the given specification. 2 /PU Purge the directory (/PU:n) 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. 2 /SD Selectively Delete Files (/SD:filespec) This switch lists all the files that meet the given specification, and for each one prompts the user to see if he wants to delete it. There are five allowable replies:- 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 the sequence and return to command level Any other response is interpreted as "N" (NO). If "G" (GO) is entered, the question "ARE YOU SURE?" is asked in order to be sure that it is the proper response. The filespec, if given, follows the same rules as for /SE. 2 /SP Spool the Output File (/SP) 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. 2 /WB Write Back the Directory File (/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 SRD [0,0]/WB 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. 2 /RD Use Revision Date (/RD) On the date selection, use the revision date (if any). In addition, if this is used for a /MI (/M2) listing the Revision Date will be listed instead of the Creation Date. 2 /SR Sort the Directory (/SR) Sort the filenames. This option is turned off if the files are not being listed or written back. You can also say /-SR to get the files listed in the order they are in the directory. This is the same order that PIP lists them. 2 /SY Include System UFD's in Wildcard Searches (/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. 2 /00 Include [0,0] in Wildcard Searches (/00) If this switch is specified then [0,0] will be included in [*,*], [0,*] or [*,0] searches. If it is switched off (/-SY) then [0,0] will be ignored. [0,0] can always be listed by specifying it directly. 2 /WD #WI 2 /WI Treat all specifications as 'wild-carded' (/WI, /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). Note that if /-WI is specified, FRED will still be read as FRED.*, but FRED. will only look for files (called FRED) with a null extension. 2 /CO Select only Contiguous Files (/CO) This switch causes SRD to select only files which are contiguous. 2 /LO Select only Locked Files (/LO) This switch causes SRD to list only files which are locked. 2 /MU Select only Multi-Header Files (/MU) This switch causes SRD to list only files which have multiple headers. 2 /ID Print out the current Version of SRD (/ID) This option will display the current version of SRD. 2 /SI Print out the available 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. 2 /AT Attach output device if terminal (/AT) 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 not specified the terminal will not be attached. 2 SWITCHES 3 DEFAULTS The following SRD switch defaults apply on this system:- /LI/M2/WD/WI/00/-AT/SY/SR 2 /ZE List Zero Length files /ZE If this switch is used, SRD will list only files of zero length, allowing them to be isolated (for possible deletion.)