DIRFILES: VER 2.0(S) ---------------------- from Horn Engineering Associates ----------------------------------------------------------------------- NOTE: DIRFILES is the property of Horn Engineering Associates. It is released to the public domain for use by anyone but it may not be sold or offered for sale, either in itself or as a part of any collection of programs, without the express permission of Horn Engineering Associates. We request that users retain the SIGNON logo intact. ----------------------------------------------------------------------- DIRFILES is a utility that creates a data files of all directory entries in the current default drive and user area. The data file contains each file name in a format that permits the user to add a description of each file by means of the resident editor within DIRFILES. For example, when DIRFILES is run, a directory display such as the following will appear: ASM .COM: The CP/M 8080 assembler. DDT .COM: The CP/M debugger utility. DIRFILES.COM: This program. DIRFILES.DAT: The DIRFILE directory data file. ED .COM: The CP/M context editor. STAT .COM: The CP/M status utility. WS .COM: The Wordstar editor. . . etc. . *** < Q = Quit > *** < E = Edit > *** *** The menu appears on the bottom line after the screen is full, and does not scroll up the screen when the display continues. When the last directory name is displayed a blank line is inserted and the display stops. On command to contine, the display starts at the top again, with the first directory entry. The file descriptions are entered by the user via the 'E'dit function. The directory entries are sorted alphabetically, and resorted each time the data file is loaded. When in the 'E'dit function, the program asks for the name of the file for which the description will be added or edited. A single RETURN here will cause an exit back to the display and main menu. If the entered file name does not exist, a message to that effect will appear and the program will revert to the editor prompt. After entering new text for a file name, a RETURN will bring back the prompt for another file name. When at the beginning of the text line and no edit is desired, a single RETURN will exit back to the display and the main menu. When editing an existing entry, the new text may simply be written over the existing text. When done, enter a RETURN without regard to any old trailing text. It will be automatically deleted. CAUTION: A single RETURN will abort from anyplace in the editor without changes. However, If any character (even a space) is entered before RETURN while on the descriptive text line, the original text will be deleted. No problem here, just edit the same file name again to restore the text. If this procedure seems complicated, try it. It is really very simple. When DIRFILES is first run, you will be asked if you want to create a DIRFILES.DAT file. This is the file that will contain all the current directory file names. You must have available sufficient disk space on the default drive and user area for the file to exist. The maximum number of directory entries for a SSSD diskette is 128. 80 columns are allocated in the data file for each entry. This will create a fixed length data file that will require 10K of disk space. The distributed version of DIRFILES is set for 128 directory entries, but this value can be easily changed at the EQUate "NUMFILES" in the .ASM source code. A more practical value in many cases would be 64, which would create a 5K data file. No harm will be caused by creation of more directory entries than the program permits. However, only the first 64 entries in the directory sectors will be entered into the data file. The number of console columns are set to 80, but this value can be changed at the EQUate "COLUMNS". The number of screen lines is set to 24 at the EQUate "SCREEN". Any of these values may be changed and the program can be reassembled, using ASM or MAC, to suit your taste. After the .DAT file is created it will not change in size. DIRFILES calls it in each time it is run, and always writes it back to the disk when done, but only after erasing the original. In this way, no extra disk space is required. When the .DAT file is called in, it is automatically updated to delete any file name that no longer exists (has been erased), and adds any new file name that has been created since last accessed. If the existing .DAT file has been set to R/O, it will be set to R/W by the program to permit it to be erased. If the default drive was not reset, the program will log it on by means of a disk system reset. If the diskette is write protected, the usual BDOS ERROR will appear and the program will abort without doing harm to the disk files. DIRFILES is distributed with the source code to permit the user to customize it for any particular system. The user is welcome to enhance it; however, it would seem to have about all the desirable features that it needs. The code will not always be easy to understand without flow-charting it, but it is fairly well commented. In places it is a real web of confusion. It might be desired to dynamically manipulate the data file to be only as large as it has to be to contain the existing file names. (This could lead to a problem if it grows too large for the existing disk space and we only learn about it after the existing data file has been erased). BUILT-IN RCP/M FEATURES ------------------------- Conditional assembly options are provided to permit use of DIRFILES on an RCP/M. Two options are SECURE and NOSYS. If SECURE is set TRUE, the WHEEL byte (ZCPR2) is used to switch out features that would not be desired. When the WHEEL is set secure (0): (1) When the program searches for the DIRFILES.DAT file and it is not found in the current drive and user area, it does not prompt to ask if you want to create it. It simply displays a message that DIRFILES is not supported in this area, and exits to CP/M. (2) The menu at the bottom of the display screen does not contain the 'E'dit option. Only the "Continue" and "Quit" options are offered. (3) When the program exits, it does not write the data file back to disk. It simply exits to CP/M. (4) When the WHEEL is set for full access, all normal features are available to the SYSOP. The NOSYS option causes the DIRFILES.DAT file SYS attribute to be set when it is created and when written back to disk. This option excludes SYS files from the data file and they are not displayed. The SYSOP may thus hide files from view (as does SD) by setting them to SYS. THE DISTRIBUTION LIBRARY -------------------------- The public domain distribution library, DIRFILES.LBR, contains the following files: DIRFILES.DOC This file (squeezed). DIRF-NS .ASM Source code with SECURE and NOSYS set FALSE (squeezed). DIRF-NS .COM Assembled non-secure version. (not squeezed). DIRF-S .COM Assembled with SECURE and NOSYS set TRUE (RCP/M) SOME HISTORICAL NOTES ----------------------- We first intended to retain the data file within the main DIRFILES program itself. This will not work. If the activity is not confined only to the default drive it would be possible to over-write the internal data file with the directory from another drive and ruin it, or to write the data back to the wrong disk. ZCPR causes a problem here, because if DIRFILES is not found on the default drive it looks for it in other drives and user areas. However, as it is, the .COM file is small and can reside anywhere that it can be called from. The .DAT file is little larger than it has to be without allowing it to grow dynamically as files are added. We could have configured the program to be installed for particular terminals. This would have permitted a much more functional editor because cursor control would have been available. For release to the public domain, we decided to code it for general use on any terminal. We hope that this program will be of some use to you. It does provide a means to keep track of the identity and purpose of disk files. In our experience, it is easy to lose track of what some of our files are, where they came from, which version is which, or how important they might be. Charles E. Horn,PE 29 August 1984