CFOG's PIP, December 1986, Volume 5 No. 2, Whole No. 50, page 6
Some Directory Programs XDIR, DIRR5, SDxxx, and DA21c
by Benjamin H. Cohen
The CP/M resident DIR command is very limited. Files are listed in the order they were put on the disk, unless you run a program to alphabetize the directory. File size isn't shown. Remaining directory and disk space isn't shown.
XDIR was provided by Osborne Computer Corporation with its computers. Nothing much was said in the manuals about XDIR because it's a public domain program and OCC was sort of stretching a point by distributing it with the system. XDIR shows an alphabetical directory, the size of each file, and how much space is left. It shows how many directory entries have been used, but not how many left. If you enter a paramater and a filename, e.g., Xdir *.* directry<cr>, Xdir will write the directory to a file by that name with the extension dir, in this case directry.dir. Xdir is only 2K bytes in size, and fairly quick to run. It's principal problem is that it runs one column until it has listed 20 files, then starts a second column, and a third, until it ends. It shows system files. It only shows the current user area. There are no options. A more recent version, 3.7, is compatible with CP/M 3.0 <CP/M+>.
There are a number of programs floating around under the name D.COM. The one I used to use a lot was a 1K byte version that provides a listing in three columns, or in four columns, alphabetical vertically, with file sizes. It's neat because it doesn't take up the full screen, just as many lines as necessary, and it's only 1K, a nice feature on a 183K floppy system. On the other hand, it can't be used if you have files in more than one user area because its free space listings only calculate the space and directory entries in the current user area.
The directory program that I'm using now is a bit fatter, 5K (6K on a 2K block system), and is called DIRR5.COM. It's by Irv Hoff. Source code is included in the DIRR5.LBR and it can be assembled with ASM.COM. It has the following options:
A shows all user areas C compressed display -- no file sizes or attributes E extended display -- shows file sizes and attributes F sends output to a file called ~DIR N non-stop display -- otherwise pauses at end of screenload P sends output to printer S shows system files V shows version number and date
Entering DIRR5 ?<cr> gets you a short menu showing options and samples. The command tail may also include a file specification. If none is supplied "*.*" is assumed.
Since source code is provided you can easily edit the file to select the options you want as standard, for example, you could have the extended display, with file size and attributes, as the norm.
I've also patched DIRR5.ASM to change the usual "$" flag for parameters to a "/". It's a lower case figure and easier to reach than the "$". All that is needed is to search for the "$" in the source code and convert it to a "/" when it seems to call for it.
I renamed DIRR5 "D". I enter D /AS<cr> to get an extended directory of all user areas, including system files. Here's a sample display <note that I've converted it from three columns to one column to fit the PIP column width, and omitted some of the files listed so that the "Used" and "Free" values aren't correct>:
D .COM 6k 0 :
DCU .COM 8k 0 :
DFD .SPR 4k 15 R :
Drive C:.SYS 0k 0 ARS :
S .COM 12k 0 :
WS .COM 18k 0 :
WSMSGS .OVR 0k 0 :
WSOVLY1 .OVR 34k 0 :
A: 380k Used: 14/148k
Free: 112/228k
The numbers are user areas. The "A" in the last column shows the archive bit is set, "R" that the file is "read only", and "S" that it is a "system" file.
"SD" is the "Super Directory" program of choice for RCPMs. It has lots of options, similar to those in DIRR5:
A all user areas D all drives L list library members N no page pause [more] U user area to start V show version number 4 40 col display (2-wide) 6 64 col display (2-wide) 8 80 col display (2-wide)
Aside from the different width displays, useful on an RCPM where callers have different terminals or computers, the added option is the ability to show the members of LBR files. SD can also be assembled with various options as defaults. Recent versions allow you to use a "/" instead of a "$" to select parameters, but the file is so large you won't be able to edit it on a system with 183K drives, you'll need double sided drives, a hard disk, or a 384K or larger Drive C:.
Standard SD versions are alphabetized horizontally, which most people find harder to read. There is an assembly option for vertical alphabctization.
SD adds another feature: security. You can restrict a user to a maximum drive and/or user area, prevent users from seeing system status files, etc. It's useful if you have a large hard disk system and a lot of users and you want to restrict access. DIRR5 doesn't have these features, but is quite suitable for local use on a system where there's only one user. The latest version of SD that I've seen is SD116, but it seems to have some bugs in it. The one currently in use on our RCPMs is SD112.
Another neat super directory program is Eric Meyer's DA. DA21c is just 2K bytes and reports the actual size of each file, even if your system allocates more space, alphabetizes horizontally <but can be patched for vertical>, and on request will report or change file attributes. You can also patch it for maximum drive, number of columns, and to eliminate the default "*.*" report, in which case a simple entry of DA<cr> will report only the total of the files, the total used, and the free space.
DA can report and set file attributes: R <read only>, S <system, i.e., is not listed in response to a DIR<cr> request>, A <archive bit, i.e., edited since last archived or backed up>, and 1-4 <CP/M doesn't use these, but you can set them and some directory programs and NewSweep have versions that show these attributes in reverse video or highlighted depending on your screen characteristics>, and change them easily. To set a file to system status you enter:
DA <filename> +S<cr>
To change it back, you enter:
DA <filename> -S<cr>
The "+" means add this attribute, the "-" means take it away. More than one attribute can be set at one time.
DA supports ZCPR [du:] formats, that is, you can enter either a drive or a user area with a colon: DA 3:<cr> will report on user area 3 of the current drive. The free space is reported correctly, unlike D.COM.
For a quick report on free space, enter DA x<cr>, unless you have a file named "x"! This works with most directory programs.
All of these programs run on CP/M 3.0 <CP/M+>. Pick the one you like, or try another of the many super directory programs available in the public domain.