SAP-Z Version 1.1 Gene Pizzetta October 13, 1990 Based on SAP60.DOC by Irv Hoff SAP-Z, based on SAP version 60, is a ZCPR3 utility that sorts and packs a disk directory. It reads the disk directory tracks, sorts them alphabetically, erases the tracks with E5's, and then rewrites them. Sorting the directory in this manner offers several advantages: (1) it allows DIR to show an alphabetized listing; (2) it minimizes problems when using UNERASE; (3) it speeds up access by directory programs; (4) it assists on working directly on the disk with disk utilities such as DU; (5) it prevents somebody else from reading files you erased; and (6) it optionally erases all null (zero-length) files, except disk labels starting with a special tag character. USAGE: SAPZ dir: Either a DU or a DIR specification must be used; for safety, the default DU is not assumed. Only the drive is significant, but if only a user specification is given, the default drive is selected. If no drive specification is given, a brief usage message will be displayed. WHAT IT DOES: SAP-Z is a program developed through the years to clean up the disk directory tracks of a CP/M disk. It works equally well on tiny floppy drives or gigantic hard drives with a capacity in excess of 100 megabytes. The directory is checked to see how many files it contains and memory is checked to see if it is sufficient. (At 32 bytes per filename more than 1500 filenames can be easily handled with a 50k TPA, and most users have more TPA than that.) The filenames are read into memory from the directory tracks, then the entire directory track area is cleaned off using E5h characters. The filenames are sorted using the same fast sort routine in current versions of Super Directory (SD), and then writes them back to the directory in alphabetic order. SAP-Z can do strange things if there are garbaged entries on the directory tracks, so it's best to use a program like CHKDIR first and make any necessary corrections before running SAP-Z. ERASING FILES: SAP-Z erases files with a filetype of "$$$" and, optionally, erases null ("zero-length") files (see "Configuration", below). Many people use names on their user areas to identify that directory or disk labels for cataloging with FATCAT, MCAT, or NCAT. These are usually null (zero-length) files: -UPLOADS 0k ; for RCP/M directory identification #GAMES .123 0k ; for catalog programs You obviously don't want these files erased by SAP-Z, so ZCNFG can be used to configure SAP-Z keep all null files, erase all null files, or erase all null files except those beginning with your label tag character (see "Configuration", below). DATE STAMPED FILES: SAP-Z preserves DateStamper file date stamps. These routines were added by Bridger Mitchell of Plu*Perfect Systems. After the directory is sorted and written back to the directory tracks, the !!!TIME&.DAT file is sorted and rewritten also, so all date stamps are kept in the right order. RELOGGING: SAP-Z no longer requires calling RELOG or DISKRST to reset hard disks. Under CP/M's BDOS and under ZRDOS, SAP-Z calls function 37, including all drives in the vector, followed by a call to function 13. Under ZSDOS and ZDDOS, function 37 is bug- free, so SAP-Z uses it to reset only the specific drive it has just packed. CONFIGURATION: SAP-Z can be used without alteration on any size floppy or hard drive. It is intended only for ZCPR3 and a CP/M 2.2 compatible BIOS. The program will abort with a message if it run under a vanilla CP/M system, or if it is run under Z3PLUS. Two configuration options are available and may be set using ZCNFG and the SAPZnn.CFG file. Do not change the name of the CFG file. The name ensures that ZCNFG will be able to find the correct configuration file even if the name of SAP-Z is changed. The first configuration option determines whether null files will be erased. By default null files are left alone. A "YES" (non- zero value) here allows them to be erased. The second configuration option has no effect unless the first option (above) is set to "YES". The option sets the tag character. The tag character is the first character of disk labels, such as those used by cataloging programs. This character is usually "-" (2Dh), "#" (23h), or "!" (21h). If this option is configured to a non-zero value, disk labels beginning with that value will not be erased, even if Option 1 is "YES". If you don''t want disk' labels preserved, make this option null (00h).