SRD---SEARCH DIRECTORY UTILITY 1 DEC 1979 SRD is a RSX-11 utility to list a UFD sorted alphabetically. It can also select files by date and by parts of the file-name. The format of default listing is such that it can be easily edited to create an indirect file for PIP, for example, to copy the files. Multiple versions are sorted in descending order-that is, the highest versions appear first. The format of the command line is: SRD [outfile]=[dev][UFD][simple-select-template][/switches] The defaults are: SRD TI:DIRECTORY.LST=/NA/SR/LI/RD Wild cards are permitted in the input UFD spec. During a wild-card UFD scan, a directory with no files in it will not be listed. A "simple-select-template" is any filename acceptable to CSI. If specified, and there is no "/SE:" switch, it as if the /SE: switch were specified, with the "simple-select-template". SRD has to read the entire directory into core before sorting it. The size of it's buffer can be increased by installing it with an increment. On an 11M system, it will try expand itself dynamically. If it cannot fit the entire directory in core, it will give a warning message and do the directory in chunks. Each chunk will be sorted seperately, however. A write-back will be cancelled in this case. ***** OPTION SWITCHES: ***** SELECT VERSION: /SV[:n] This switch selects the version. It has the same values as standard-- -1 for oldest, 0 for highest, anything else is itself. If "n" is omitted, the highest version is assumed. USE REVISION DATE /RD On the date selection, use the revision date (if any). If /-RD is specified, the revision date is never used, only the creation date. DATE: /DA[:DD-MMM-YY] Selection only files created or revised on the specified SRD---SEARCH DIRECTORY UTILITY 1 DEC 1979 PAGE 2 day. If no date is specified, the current date is used. The revision date is used, unless there is none, then the creation date is used. (Note that creating a file normally includes both a creation and a revision). BEFORE: /BE:DD-MMM-YY[-E] AFTER: /AF:DD-MMM-YY[-E] Select only those files that were created or revised before/after the specified date. The dates are strictly before/after unless "-E" is specified. If both /BE and /AF are specified, only files created or revised between the dates are selected. SELECT /SE:[template] This switch allows file names to selected based on a sub-set string match. The selection is satisfied if the end of the target field is reached without finding a character that does not match. The filename is considered to be a string of 1 to 13 characters: 0 to 12 characters of name, a period, and 0 to 3 characters of type. The filename and the specified template are compared one character at a time. If the current template character is a "%" or "?", it will match exactly one character of the filename. If the current template character is "*", it will match 0 or more characters in the filename that are DIFFERENT than the next character in the template. More than one "*" in a row is treated as only one. For example: SRD /SE:M* This selects all files with "M" as the first character in the name regardless of the rest of the name. /SE:M???X.* This selects any file with a name starting with "M" having any characters in 2nd, 3rd and 4th position, X in 5th position. /SE:*SRD* This selects all files having "SRD" anywhere in the filename, such as : SRD.MAC, SRDATA.MAC, TKBSRD.CMD, ABCC.SRD, etc. SRD---SEARCH DIRECTORY UTILITY 1 DEC 1979 PAGE 3 NEGATE NAME SELECT /NE Select only those filenames that do NOT match the template. SELECTIVE DELETE /SD[:Template] List each selected filename on the terminal, then prompt to ask if it should be deleted. The read is for one character. If the response is "Y" or "y" , SRD deletes the file. Any other response causes SRD to proceed without deleting the file. NOTE Entering CTRL/Z will terminate the selection, and return to prompt for the next command input. DELETE ALL SELECTED FILES /DE All selected files will be deleted after listing. If the listing is not desired, the -LI switch can be applied. LIST FILENAMES OF SELECTED FILES /LI In addition to header & trailer lines for each UFD, the filename of each selected file is listed. The trailer contains the number of files selected, and total number of files in the directory. If one of the switches: /MI, /FU, /DA, /AF, or /BF was specified, the total number of blocks used/allocated (for those files selected) is also listed. (This numbers will be in the trailer line even if /-LI was specified.) MIDDLE SIZE LISTING /MI In addition to the filename, the creation and revision dates will be listed. FULL LISTING /FU[:N] This causes additional listing of: 1. Creation and revision date and time & revision SRD---SEARCH DIRECTORY UTILITY 1 DEC 1979 PAGE 4 number (if greater than 1) 2. File size - used and allocated (decimal values) 3. File I.D. 4. Owner UIC 5. Protection SPOOL OUTPUT /SP The output listing will be spooled. SORT BY FILENAME, THEN BY EXTENT /NA This controls whether the files are sorted by name first (/NA) or by type first (/-NA). SORT /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. LIST SYSTEM UFD's /SY Normally, system UFD's will be ignored if there is a wildcard specified in either field of the input UFD. System UFD's are those of [11,*] and below. This switch has no effect unless there is a wildcard in the input UFD. WRITE-BACK THE DIRECTORY /WB The directory is written back. This not only orders the directory, but compresses it. This reduces search time by FCP if the directory has had a lot of files deleted. 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. SRD---SEARCH DIRECTORY UTILITY 1 DEC 1979 PAGE 5 ***** EXAMPLES ***** SRD DA/SD:MAK* Prompt for selective deletion for all files whose filename starts with "MAK", which have been created or revised on the current date. SRD /SD:* This allows selective deletion of ALL files. SRD /BE:1-JAN-76/DE Delete all files created before 1-Jan-76. SRD [100,101]/-LI/WB/NA Read the directory [100,101], sort the directory by name, then write it back. The individual filenames will not be listed. SRD [*,*]/-LI/MI/SE:*.MAC or SRD [*,*]*.MAC/-LI/MI/SE Scan all UFD's of [12,1] and above, for all the ".MAC" files. Do not list the individual filenames, but for each directory list the number of files (both *.MAC and total) and the number of blocks used/allocated for the ".MAC" files. SRD [*,*]/SY/-LI/BE:1-MAY-79 For all UFD's, show the number of files and the number of blocks they occupy, which are older than May 1, 1979. This is handy to use to find old files that might be eligible for being rolled off-line.