CATALOG OF LIBRARIES AND ARCHIVES by Saul G. Levy 2555 E. Irvington Rd. #47 Tucson, AZ 85714 (602) 889-7753 5/5/88 That's what CATLA stands for! I had trouble finding all of my combined files and decided to put them in alphabetical order on a separate set of diskettes (32 right now). A MAST.CAT cata- log file came next, but I wanted the individual member's names too. Such a file makes it very easy to compare different ver- sions of what may look like the same .LBR, etc. Super Directory (since version 1.25) has offered a list of both .LBR members and .ARK/.ARC members. Since this information can be written to a file, I decided to use SD's DISK.DIR files (one on each disk; leave 2-4K free for it). Every change in the contents of a disk mean you'll have to ERAse DISK.DIR and rerun SD. This sounds like a lot of extra work, but it is very much worth it! In short, that is why CATLA.BAS was written to use MASTLA.CAT files. You need two floppy drives (A: and B:) for this package as currently written. CATLA.COM can run in under 30K of free RAM, but 46K is the minimum needed to take advantage of the full 24K buffer I provided (see Using CATLA below). Distribution This package is provided for free and may not be sold in any form without the author's permission, including by user groups which charge for the disk or making a copy. My programs are cop- yrighted, the copyright statement may not be removed, and this entire documentation file must be provided. These terms also ap- ply if anyone wishes to supply the two CATDEL files in a separate library or archive. I would also appreciate it if the CATLA.LBR file were to be upgraded as needed, but NOT stripped of any current member files. Those of you BBS users who upload only one file thinking you're gaining brownie points are most definitely NOT appreciated by serious users of public domain software! The documentation, and even the source code files, are VERY IMPORTANT to those who wish to use PD software! The terms CATLA and MASTLA are hereby given to the public domain. I welcome the creation of more utilities for use with MASTLA.CAT. General File Information This has turned into a complete package. Here is a list of the files, including those created by CATLA: CATLA.BAS The source code and main program which will: add/- CATLA.COM update DISK.DIR files to the MASTLA.CAT catalog file, delete anything you wish (note the warnings given!), list the catalog file four ways, and create a pointer file to allow a selected list of the cata- log file (! to Z). The entries are of fixed length to allow for this. CATDEL.BAS The source code from the deletion routine except the CATDEL.COM file it looks for is MAST.CAT on the default drive. Actually, this will work with ANY text file (if you REName the file to MAST.CAT, or change the program and recompile). This facility has been needed for a long time. MASTLA.CAT Current catalog file. .BAK is the previous copy and MASTLA.BAK .TMP would become the new current file if an error MASTLA.TMP occurs (or you stop the program, Control-C works at any time). Normally you'll need room for all three copies, but the .BAK and .TMP files can be manually ERAsed at any time. SD127.COM Super Directory version 1.27 used to create DISK.DIR files. Type SD ? for help. I know this version works (there are many options, but the order of mem- ber files can't be changed). Full documentation is available in any recent SDnnn.LBR file. DISK.DIR The disk directory file on each disk you wish to run with CATLA. Created with SD127.COM. Your disks MUST be logged-in to write this file (or add the R option). The command is SD $AFL for whatever disk is in the default drive. You can ignore the A if everything is in user area 0. Note that DISK.DIR will be APPENDED to if it already exists (you must ERAse any old version before running SD). POINTER.FIL Small pointer file, created by CATLA, which contains two-byte, binary integers (not readable). I've modified a number of the old MAST.CAT utilities to use the new MASTLA.CAT files. Some of these have a command-line par- ameter for printer output (otherwise, use a Control-P). Only CATPAGE.COM had to be changed to skip over the longer, () skip- file first record (no actual files to skip are used, or needed, but this maintains compatibility with MAST.CAT). I have no source code for the first two which will list MAST.CAT as not being found instead of MASTLA.CAT (please ignore this). In case you don't already have copies of these programs, here is enough information for you to use them: CAT.COM The parent program for CATFILE, CATPAGE, and CATR. This is a more recent version which lists MASTLA.CAT to the terminal in pages with no stop after each one. The longer, skip-file entry will output two periods instead of being ignored. Enter any charac- ter to stop. The complete command line is: CAT [filename.typ][diskname.nnn][ comment] The file name and disk name can contain any of the usual CP/M wildcards (*.*, A*.* or A???????.* will find all file names starting with an A, while -*.* will output all minus file names and disk names). When using the disk-name field, you must put some- thing in the file-name field, e.g., *.* *.5* will output every entry with a disk name in the 500s (500-599). The comment is usually for the date (in any format you want). CATFILE.COM Very similar to CAT.COM, but no command line options are available. The output includes the comma after the second field and even adds one after the third field. Multiple copies of any file entry (up to four) are output on one line, but the line length is 113 characters (set your printer to 16-17 characters per inch). The output is a bit ugly, but you don't have to use this program. CATPAGE.COM Almost identical to CAT.COM with the same command line, but it stops after each page. Hit any key for the next page; hit it twice to quit. Add a #P be- fore the comment field to output to the printer. CATR.COM Similar to CAT.COM, but in order by disk-name num- ber. The command line adds two extra parameters: CATR [filename.typ][diskname.nnn][#C][#P][ comment] If you just enter CATR, the default disk-name number will be 000 and it will read the file 1000 times showing all files on each disk. If your disk num- bers don't start with 000, you must give it a start- ing disk number (or wait a long time!). The file- name field must appear too. This will output only the first disk-name's entries unless you add the #C which will list the first and ALL following disk- name numbers (e.g., from 500 to 999). This is an interesting program which actually runs fast (about 16 seconds for each pass of my 61K file). You can also use FIND.COM (not included) for fast searches (CATR is faster, but either is faster than CATLA.COM can work). XCAT.COM Only file names and disk-name numbers are output to the printer or a file (duplicate file names will take up only one line). Since the file names are actually within a combined file, you can have dupli- cate file names on the same disk. Answer the ques- tions any way you like. The default, output file name is MASTLA.LST, but you can give another one on the command line. The number of file names and u- nique file names will appear at the end. A Control- C stops the program, but not during the writing of a file. ERAse this file if your disk space gets tight (it is about one half the size of MASTLA.CAT). Getting Ready for CATLA (Using Super Directory) Put a copy of the .COM files above on drive A: with your system and anything else you like (the MASTLA files will be cre- ated on this drive). Put each of your .LBR/.ARK/.ARC disks in drive B: and run SD after you log-in to drive B: as the default drive (SD $AFL or SD $FL if user area 0 files only; add an R to reset all drives). I use ZCPR and don't have to add the A: be- fore the SD each time. This package is meant for floppy drives, but if you wish to use it with a hard disk, please let me know the details for a custom version. Note that the FIRST MINUS file name in DISK.DIR should be a legal, disk name (-DISKNAM.nnn) with a three-digit number filling the file type. CATLA accepts whatever it finds and won't com- plain, but the other utilities expect a number which is MAST.CAT- compatible. The disks I'm running contain only a disk name and the combined files; yours could have other individual files which start with a minus sign. Take care of this BEFORE running CATLA. There are nonstandard archives (I haven't seen a .LBR with an unusual directory). SD will give the header information, but instead of the member names will give only one line of: ++ Not a library file ++ or ++ Not an archive file ++ CATLA will ignore these since they become file names of 12 characters with no period (++ Not a lib and ++ Not an ar). I had this occur with UNARC16.ARK which has a nonstandard directory of member files. It's first file is a runable, noncompressed .COM which can be run within the .ARK to unpack its members. This di- rectory can be read by UNARC.COM, of course. If you want to in- clude the members within MASTLA.CAT, you will have to manually edit them into the appropriate DISK.DIR file. That stinks, but what else can I do since I'm relying on SD? Using CATLA After getting ready you can run CATLA on as many disks as you like (disk space is the only limitation). CATLA.COM uses a dynamically-allocated, 24K buffer to speed up file handling. My 61K file takes about two minutes to update or delete, and uses only three read/write passes. If you have less than 46K of free RAM, the program will still run as written (in less than 30K), but the number of read/write passes will increase accordingly. CATLA.BAS can be run if 16K of free RAM is available (in a 58K TPA). It was written with Zedcor's ZBASIC, version 3.10, and should work with most ZBASICs (how you create DISK.DIR files un- der other operating systems is your problem!). Add/updates and deletions will be much slower due to the minimum-sized buffer a- vailable. All commands to CATLA can be in lower case. Deletions must use the exact format of what you want to delete (see below). Use a Control-C to stop at any time (if the program isn't paying at- tention during listings, repeat as needed). This never works if it is waiting for you to type something! ZCPR users can type GO to rerun the ZBASIC programs without reloading. Add/Update Command Add/update will create MASTLA.CAT, if it doesn't exist, then read DISK.DIR in drive B: to add or update the catalog. Drive B: is for reading only, so change disks at any time. CATLA will say "Reading MASTLA.CAT" twice the FIRST TIME you run it. Updating totally DELETES ALL PRIOR REFERENCES to any entries from the SAME -DISKNAM.nnn! Deletions will occur while "Reading..."; additions while "Writing...". Remember, the MASTLA files MUST be on drive A: only! Delete Command Delete will do this for ANY text you give it except ALL SPACES! Read the instructions at the beginning of the delete routine. Note that each entry in MASTLA.CAT is of fixed length (37 bytes plus CRLF = 39 bytes). The () skip-file record is blank-filled to match and SHOULD NOT be modified or selected lists won't work! I left each file name, disk name, and .LBR/- rated fields contained in each entry). Spaces take up 13.9% of my 61K file so the overhead isn't too bad (and time isn't wasted for space removal and addition). A Digression: The MASTLA.CAT File Format An example: If you had STAT.COM in the library STAT.LBR on a disk named -BACKS.123, its entry would look like: STAT .COM,BACKS .123,STAT .LBR and be deleted by entering STAT .COM (in upper case only and include four spaces). The comma after .COM could also be added. Normally, I didn't intend that delete be used for individual en- tries, but this is available (it runs fast enough to be usable). The file name always has 12 characters total, the disk name has 11 because the minus sign is removed (a la MAST.CAT), and the MAST.CAT (this can be shown by using the extra utilities I've in- cluded: all run). That's 35 bytes plus two commas and the CRLF. The disk name and each .LBR/.ARK/.ARC name also get an entry: -BACKS .123,BACKS .123,DISKNAME. STAT .LBR,BACKS .123,STAT .LBR These look like a file-name entry except that the file name field contains either the minus sign or the .LBR/.ARK/.ARC name. DISKNAME. (there are three blanks following it) allows a quicker listing (I don't have to read the entire file, just the minus file names). All disk names will group together, but member files often start with a minus sign (or two) and will precede the actual disk-name entries in the file. No other fields are used (a la YANC.COM) simply because there isn't any room to print them in two or three columns (no user area, file size or .FRE either). I'd like to have the file sizes, but alas... List Options Submenu Command List Options Submenu will display another menu with four op- tions. You can get the disk names only, all .LBR/.ARK/.ARC names, selected areas of MASTLA.CAT (to any character shown in the first column of the file-name field), or the entire file. All listings can be sent to the printer (whichever one CP/M is setup for). The .LBR/.ARK/.ARC names also give a count of each plus the total number of files in MASTLA.CAT. Terminal output uses 23 lines; the printer 60. The first two list options print in three columns (the third option lists the entire data you selected in two columns. If you want all file names which start with numbers, enter a 0 for the first character, and a 9 for the second. Other symbols are supported, but you can't use ( to see the () skip-file record (it can't be listed, or deleted, at all). Any file name which starts with the ASCII characters before ( can be listed (! to '). If you want to select all file names from J through L, enter J, then L for the two characters. The second character must be "EQUAL or GREATER!" than the first or you'll get that error mes- sage. Finally, the entire file is listed in two columns. Note that a formfeed is used to eject each page on the printer (some of the utility programs use it too). (The clear screen is for an ADM-3A, by the way; you can change the two bytes at 180-181H in the ZBASIC .COMs, but 182-183H aren't available.) Pointer Create Command Pointer create will create POINTER.FIL and save the entry pointers where each ASCII character first appears in the file- name field (! to Z are usable). Both add/update and delete will ERAse this file ONLY if something is actually added or deleted. If you try to list a selected part of MASTLA.CAT when POINTER.FIL doesn't exist, you will get a "No POINTER.FIL File Available!" message and have to run this function again (this is not automat- ic, but it does run fast). File Error Messages The following are supported (all will abort the program): During add/updates: File error in DISK.DIR: Missing file or wrong format! or -DISKNAM.nnn missing in DISK.DIR! During add/updates, deletes, and pointer creates: Disk full error! The disk in drive B: must have a DISK.DIR file on it in the proper format (I doubt the latter will change, but...). Create one with Super Directory (see Getting Ready for CATLA... above). CATLA will never write to drive B: so you can change disks when- ever DISK.DIR is NOT being read. SD, however, can only write to a logged-in drive! A legal, disk name should exist in every DISK.DIR file. If you haven't already done so, create each one with the following command to CP/M: SAVE 0 -DISKNAM.nnn (nnn must be a three-digit number from 000 to 999). ERAse any old DISK.DIR file, then run Super Directory to recreate it. If the disk becomes full, ERAse any of the following files (in largest-to-smallest order): MASTLA.BAK MASTLA.LST POINTER.FIL Note that MASTLA.TMP was probably being written at the time and ERAsing it won't save you any disk space. Directory full errors aren't listed in the ZBASIC manual (these are rare anyway). Credits Great appreciation is due to the numerous authors of Super Directory and for the equally numerous catalog programs and util- ities! This file was right justified with Irv Hoff's new JUS.COM (part of JUSTIFY.LBR).