ERASE Version 5.6 Gene Pizzetta November 4, 1990 ERASE, originally written by Richard Conn, erases a list of files from one or more directories. Options allow prompting before each file is erased, inclusion of system files, erasing read-only files without prompting, and erasing all files (*.*) without asking you if you know what you're doing (handy for aliases and batch operations). USAGE: ERASE {dir:}afn.aft{,{dir:}afn.aft{,...}} {{/}options} If no DIR or DU specification is given, the current logged drive and user is assumed. Multiple file specifications must be separated by commas without intervening spaces. OPTIONS: A leading slash is optional. I Inspect mode. Each matching filename is displayed and the user is prompted. A response of "Y" will cause the file to be erased. Entering "Q" or ^C will exit the program. Any other response will skip the file and then prompt for the next matching filename. A Erase all (*.*) files without asking. By default if an all files *.* filespec is given, ERASE will prompt with "Erase all files on A0: ?" Using this option will cause all files (except read-only) to be erased without prompting. The prompt can be eliminated by default with ZCNFG. R Erase read-only files. By default ERASE will prompt the user if a read-only file is encountered. This option will cause matching read-only files to be erased without prompting. Erasing read-only files can be made the default with ZCNFG. S Toggle inclusion of system files. Whether ERASE recognizes system files by default is determined by a configuration byte that can be changed with ZCNFG. The default condition is reversed by this option. As distributed, the default is to exclude system files. Q Toggle current default quiet mode. Defaults to quiet flag, if it is on. Otherwise, defaults to configured quiet mode that can be changed with ZCNFG. As distributed, the default is verbose mode. In quiet mode all screen output is suppressed, except error messages and required prompts. If the R option is not given and ERASE encounters a read-only file, for instance, it prompts for permission to erase the file even if the quiet flag is on. Inspect mode prompts normally at all times. ZEX input is turned off while ERASE is running. On exit the program error flag is set to 10 (source file not found) if no files are erased, unless the program was aborted at a prompt with "Q" or ^C. In addition the number of files erased is entered into ZCPR3 Register 0 (up to a maximum of 255). An invalid option will set the error flag to 19, and, if running under ZCPR 3.3 or higher, an invalid directory reference will set the error flag to 2. The latter two errors will cause the error handler to be invoked. If a list of files on different drives is given on the command line, the disk free space report is for the last drive accessed by ERASE. CONFIGURATION: All command line options, except inspect mode, can be made the default using ZCNFG and the accompanying ERASEnn.CFG file. If the name of the configuration file is not changed, ZCNFG will always be able to find it, even if you change the name of ERASE.COM. Configuring ERASE to delete read-only files without prompting is possible, but not recommended unless you are absolutely sure you are aware of the implications. HISTORY: Version 5.6 -- November 4, 1990 -- Gene Pizzetta Only 24 hours after releasing 5.5 I discovered the usage screen was not reflecting the current effect of the S option. It does now. Version 5.5 -- November 3, 1990 -- Gene Pizzetta Added Q option to toggle default quiet mode, which is controlled by the ZCPR3 quiet flag or a new quiet configuration byte. In fact, all command line options, except I, can now be configured as the default mode with ZCNFG. Now displays DU specification with each filename, so you can be sure which directory ERASE is working on. If run under ZCPR33+, now reports invalid directory instead of trying to erase files on default drive. What a disaster that could be! Version 5.4 -- July 1, 1990 -- Gene Pizzetta Eliminated internal environment assembly option. Added configuration byte after ASCII string 'SYSFILES>' to chose whether to include system files by default (non-zero) or exclude them by default (0). S option now toggles the default meaning (it's current action is shown by the usage screen). Now filters high bit of filenames for terminals that display special characters that way. At the suggestion of Howard Goldstein, ERASE no longer signs on with its load address and version number; these are displayed only on the usage screen. Restored Q (quit) as a valid response to an erase query, but ^C still works. Display has been made even more compact than last version. Many of these changes are to make the ERASE interface very similar to the RCP version. Program error flag is now set to 10 if no files are erased, unless the program is aborted with a ^C or with a "Q" response to a prompt. If an invalid option is given the program error code is set to 19 and the error handler is invoked. Added disk free space display. Now obeys ZCPR3 quiet flag, except when in inspect mode or when a prompt is necessary (when a read-only file is found, for instance). Removed Wheel byte protection for S and R options. Version 5.3 -- March 25, 1990 -- Gene Pizzetta Added A option to suppress "Erase all files?" question when "*.*" is given as a filespec. This option is primarily for use in alias scripts and batch files, where you might want to clear a directory without ERASE stopping to ask if you know what you're doing. Rick Charnes added some nice features in v5.2, but succeeded in badly messing up the display for all prompted erasures. That has been corrected and the Q (quit) option has been eliminated. Instead, ^C now aborts ERASE at any prompt. Version 5.2 -- January 24, 1989 -- Rick Charnes Three changes: (1) Now turns off ZEX input while program is running. This is important when ERASE.COM is used in an alias inside a ZEX file under certain circumstances and ERASE.COM requires user input, such as if its Inspect option is used or if R/O files are encountered. Otherwise the ZEX script itself would be sent willy-nilly into the prompt rather than allowing the user to do so. (2) The ZCPR3 error flag is set if program did not erase any files. This can be useful in aliases when the correct execution of the remainder of an alias is dependent on a successful erasure. The error flag is cleared if any files were successfully erased. (3) ZCPR3 register "0" is set to the number of files successfully erased. This can also be nice for aliases. I always liked this concept, for which my inspiration was Jay Sage's doing the same thing with FF.COM, which sets ZCPR3 register 0 to the number of files successfully found. Version 5.1A -- December 30, 1987 -- Bruce Morgen Fix option parser as per RENAME32, strip high bit when printing program's actual name for help screen, wheel byte checked before granting "S" or "R" option, or help text on these options. Version 5.1 -- December 21, 1987 -- Bruce Morgen Z80 opcodes, Zilog mnemonics, and ZCPR33 Type 3 format. Usage message gives correct COMfile name of program. Following Howard Goldstein's (LX17 & 18) lead, the ZCPR 3.3 parser is used if it's available. Version 5.0 -- May 18, 1984 -- Richard Conn Version 4.0 -- January 16, 1983 -- Richard Conn Version 3.3 -- January 6, 1983 -- Richard Conn Version 3.2 -- December 7, 1982 -- Richard Conn Version 3.1 -- November 9, 1982 -- Richard Conn Version 3.0 -- October 18, 1982 -- Richard Conn Version 2.0 -- November 18, 1981 -- Richard Conn Version 1.4 -- October 26, 1981 -- Richard Conn Version 1.3 -- October 25, 1981 -- Richard Conn Version 1.2 -- April 12, 1981 -- Richard Conn Version 1.1 -- October 19, 1980 -- Richard Conn Version 1.0 -- June 14, 1980 -- Richard Conn