Gcat:- a simple Amiga disk catalogger by John Marchant (aka "Gnome") ------ Version 45.20 18 June 95 This program was developed as a project while learning C. It is still being developed as ideas come for improvements. My best ideas come when I'm in my bath, on the toilet seat or gardening. To anyone who dislikes my spelling of "catalog", I say "Tough. I'm logging the disks and I like to call the result a catalog." *********************************************************************** ##### NOTICE ##### PLEASE NOTE that Gcat has not been idiot-proofed. There is no protection against making silly data entries in the Edit and Insert options. *********************************************************************** The program is Public Domain and must be accepted "as is". NO WARRANTY is given that it is bug-free, and NO LIABILITY is accepted for any damage it may do to your hardware, your software or your peace of mind. However I use it and I'm happy with it so far as it goes. I'd call it "cheap and cheerful". -------------------------------------------------- The following files should be supplied with any copy of this program:- GCat The catalog program. CatHelp.txt The online help text. Should be in the same directory as Gcat. req.library Copy this into your libs: directory if you don't have it. testfile.cat It's just a sample catalog to play with. Gcat.doc The file you are reading. This file includes CatHelp.txt Gcat.guide My first attempt at writing an Amigaguide ppmore Utility for displaying help text. This should be in your c: or your sys:utilities directory. --------------------------------------------------- Gcat may be started from the CLI or from Workbench. If started from CLI with an argument c (i.e. "Gcat c") an alternative color palette (grey, black, white, yellow) will be used. Otherwise the Workbench preference setting will be used. If you start it by a CLI command, you should first change directory to the one in which your Gcat program and this help text are held. Otherwise the program will not be able to find the help text file, and will complain. So you should.... cd run Gcat or of course you can use a wee startup script that does this for you, and you could execute this script using an alias. Or you could be clever and use IconX to execute the script. If you start from the Workbench icon, there's no need to change directory. There is a limit of 5000 set on how many files may be added to one Catalog. I'm not sure why, but there must be _some_ limit set, and 5000 seemed like a good idea! This may be revised later. (See also "Bugs" below.) ==== The following text is also in 'CatHelp.txt' for online viewing ==== The program is controlled by pulldown menus or hotkeys. USING GCAT ============ To add data to your catalog you must first select the drive which will be used for collecting data. Then you simply insert disks into this drive and press RtAmiga/A each time. The rest is automatic. If you want to edit or delete an entry, point to it and click with the left mouse button. The Edit window appears. Click on Edit or Delete, make any changes, and then click on Accept or Cancel. You can also click & drag the pointer to select several lines, but the dragging can't be used to de-select items already highlit. To do this you must click on individual lines. The reason for this is to avoid accidental deselection. (That's my excuse anyway.) To insert an extra (new) entry, select the Insert menu option and follow the instructions below. The MENUS. ~~~~~~~~~~~ Options menu ============= SELECT INPUT DRIVE This is the drive from which data will be read & added to the catalog. e.g. If you select DF1: then all file names on DF1: will be added to the catalog - ** even if they already exist in the catalog ** Only currently available drives will be offered. The drive you select here remains the drive used for gathering more data, unless you select a new one from this menu option. It is unaffected by the drive & file you may select to "Load Existing Cat" (though these may be the same file & drive). ADD DATA FROM DISK (RtAm/A) This will cause the 'Input Drive' to be scanned, and all file names (except those with .info extensions) will be appended to the current catalog file in memory. The Catalog file will then be sorted & displayed without further menu selection, and you can use the editing facilities described below under 'Load Existing Catalog'. You may then proceed to select further menu options, such as add further data (from the selected "Input Drive"), change the current input drive, or load an existing catalog. SAVE FILE (RtAm/S) When you load an existing catalog file, or "add data from disk", file names forming the catalog are read into memory. If any change is made (edits, additions, deletions) you may wish to save the altered catalog. If you ask to load a new catalog or quit without having saved, a requester will remind you and ask if you wish to save. If a catalog file name has not yet been specified, a requester will appear for this purpose. SAVE AS (RtAm/N) This is the same as SAVE FILE but asks you the name of the file you wish to save to. e.g. you may wish to save it in a different place or under a different name. (The 'N' hotkey represents "Name"). LOAD A CAT FILE (RtAm/L) This enables you to read an existing catalog. A requester will appear for you to select the path and file. The file & drive you select here do not alter the current input drive. If you want to add data to the catalog you select here and it's on a different drive, you must use "Select Drive" to set the new "current input drive". START NEW CAT Use this to clear the current catalog held in memory and begin a new one. If changes have been made to a catalog currently held, you'll be asked if you wish to save this first. SELECT SORT This produces a submenu with 2 options: SORT ON FILENAME (RtAm/1) SORT ON DISKNAME (RtAm/2) These control the presentation of the list on screen. You can change the sort at any time. QUIT (RtAm/Q) This is a way to exit the program. You can also exit by using the window close gadget. If a catalog is currently in memory & has not been saved since it was last changed, a requester will appear to remind you. ------------------------------------------------ Insert Menu ============= INSERT ITEM (RtAm/I) ------------ Selecting this will bring up an 'Insert window' with several string gadgets, and 2 button gadgets (OK and Cancel). There are 4 fields to be entered: File Name Path File size (bytes) Date See also "Edit window" below. Until the program is properly idiot-proofed, care should be taken to enter data correctly. See the screen display for formats. After making an entry and clicking on Accept, the new item is planted in the file list, which is then re-sorted and displayed. Help Menu ========== HELP (RtAm/H or Help key) ----- This will move the working screen to back and call ppmore to display this text file you are reading. After use, the work screen returns. Please note that ppmore should be in your C directory, or some other dir for which a path has been assigned for commands (e.g. Utilities). Printer Menu ============= PRINT CATALOG (RtAm/P) -------------- This formats and prints the catalog file currently displayed. You should have your printer ready for action, as printing starts as soon as you have made the request. WRITE TO FILE (RtAm/W) -------------- This will bring up a requester asking for the path & name of the output file. The catalog currently being displayed will be formatted and written to the selected output file. The Catalog data file is packed, with many spaces removed, but 'Write to file' will format it as it appears on the screen. Unlike 'Print', there will be no page-breaks. SET PAGE LENGTH ---------------- This allows you to change your print page length from the default 66 lines to some other value (eg for A4 cut sheets). Two blank lines will always be left at the foot of each page - ie 64 lines will be printed on a 66 line page. Note that you cannot change the pagelength during the printing. SET LETTER QUALITY ------------------- Use this option if you want non 'draft' quality and your printer does not have a high quality option switch on it. Setting this option only changes the copy of your printer preferences currently held in memory (and restores to its original setting after printing). It does NOT alter the setting of your Preferences held on disk. If you already had 'Letter quality' set in your Preferences, this option will make no difference. ---------------------------------------------------------------- When a Catalog is displayed, you can scroll the text up and down, using the proportional gadget or the arrow gadgets at right of screen. You can also highlight lines by clicking on them with the left mouse button. Selecting lines in this way causes the Selection buttons to appear. The Selection buttons ---------------------- If you click on one or more lines on the screen, those lines are highlighted and the selection buttons are revealed. Deletions & edits do not take effect until 'Accept' is selected. Delete:- if you click on this one, you are asking to delete all lines you have selected whether or not they have scrolled off the screen. Edit:- brings up a 'string requester' containing the most recently marked line, and you can edit the line. Press OK to accept, or press Cancel. If more than one line was previously selected, only the most recent one can be edited. Any others are unaffected. Accept:- accepts any changes into the catalog data. Cancel:- cancels the changes you have made and conceals the selection buttons. ================== End of 'CatHelp.txt' ======================= The Catalog file (This section for enthusiasts only!) ----------------- This is a text file which may be edited if you wish. A text editor can be used: but be sure to retain the format, which has field separators as described below. (ie the lines are 'packed'.) Field 1 holds the file names in alphabetical order. Field 2 holds the disk name from which each file was extracted, and the name of the lowest level of sub-directory in which it resides. e.g. a file on df0:games/zaptype/Amoeba shows as Amoeba df0:zaptype This is only for reason of space in the line. Field 3 holds the file size in bytes, left-padded with spaces to 8 characters. Field 4 holds the date found on the file. If this is silly, then the file has a silly date (or you entered it wrongly when editing). Fields are separated on the file by the vertical bar character | Until a "search" facility is added, the easiest way to search for a file name is by using a text editor such as Cygnus Ed, or the DOS "search" facility. ---------------------------------------------------------------- Recent History ================ Vn 41 Revn 5: Option to use Workbench colours (by default), or my own choice of colours (using 'c' argument). Vn 42 Revn 0: The window and all gadgets now size themselves according to the user's screen size. This cures problems with overscan or non-standard screen heights. Revn 1: Printing bug now corrected. Output text looped on start of each page from page 3 onwards due to really stupid coding error. Revn 2: Inability to "see" drive Df2: now fixed. Revn 3: Cosmetic tweaks of no consequence Revn 4: Tiny bug fixed. It was possible to select a line one below the bottom of the display window. Messy! Revn 5: Menus disabled while in edit or insert mode. It was found possible to ask for a sort while lines were marked selected. This crashed the program. Revn 6: Bug fix. It wasn't possible to select bottom line of scroll. Input device submenu extended to include HD0,1,2,3 Vn 43 Revn 0: Cosmetic changes to menus, as requested by users. At LAST I've found out how to put only available disk devices into the drive selection sub-menu! It meant an extra program module, but was worth it. Revn 1: More cosmetic changes requested by pedantic friends :-) Revn 2: Bug fix: If the saved file path was long, Gcat crashed. Revn 3: Cosmetic changes, & tidying of coding used in Revn.2 Vn 44 Revn 0: Hopefully the scrolling now behaves correctly and is not upset by different amounts of vertical screen overscan. Revn 1: Bug preventing bottom 1 or 2 lines being selected: fixed. Revn 2: Further problems fixed with scrolling on different screen sizes. Is this problem finally fixed? Let's hope so. Vn 45 Revn 0: At last I've figured out how to sort by file name within disk name & path. This fulfils a long-time ambition :-) Revn 1: Cosmetic improvement - Menus tidied Revn 2: Menus disabled during reading disk or printing. It was my intention to change to ASL requesters. The file requester is easy, but a two-gadget input requester is very messy since ASL doesn't support this and a further IDCMP channel has to be set up. Using Req is far simpler, and in my opinion Req does a nicer file requester. Further development is unlikely. This project has gone on far too long (about 3 years) and I'm bored with it. But I will still fix bugs. -------------------------------------------------- BUGS? ------ 1. If you ask to "Write to disk" a very large catalog (e.g. all of dh0:) and try to put output to a file in ram: you can get a 'guru'. On a reset & retry, the problem goes away. This is with plenty of free ram: so maybe it's due to memory fragmentation? 2. Under low memory conditions the program may hang or crash with a "MemoryInsane" alert. The program checks that memory is available while reading in data, but certain activities such as sorting evidently need more memory & you can run out. I've not met this in regular use with large catalogs of 3 or 4 thousand files, but a tester has reported it. The problem may be caused by memory fragmentation, so maybe a reset before running would avoid it. 3. In Vn 43.01 a small bug turned up when I had more than 11 disk type devices available for data input. The "source drive" submenu didn't have enough slots in it, and the parent menu was corrupted. You can now have up to 15 possible input devices before any problem arises. The program has been tested on 68000, 68030 and 68040 processors, and with Enforcer. No hits were found. User Problems --------------- Bugs or nasties may be reported to me:- a) Through fidonet: 2:2500/167.15 or usenet: gnome@martinac.demon.co.uk b) By a message on my Bulletin Board "Moonlight" which is open most nights 6pm - 8am. Tel: +44 (0)1234 212752 (logon, fax or netmail). 1200 to 14400 baud, V32bis. Standard 8N1 protocol. c) By snail mail at the address below. If possible please supply enough detail so that I can repeat what you did to reproduce the bug you observed. Screen grabs are useful. Credits ========= Thanks to.... Jim Perry of "Studio Services" for field-testing this program, and for asking for the sort by disk-name. Bil Irving and Anthony Keeley for suggestions, advice & much winding me up. Steve Parkinson for helping with programming problems & showing me how to do the sort. Chris Sumner for reporting some bugs I didn't know about. Phillip Lindsay for the coding to list available disk devices - which I discovered one day on Usenet. Gavin Hamill for suggestions for improvement. Mel Potter for testing, and screen-grabs showing the scroll problem. Pink Floyd, Queen, and Nescafe Gold Blend for keeping me awake. ----------------------------- Version 45 June 1995 John Marchant, 43 Bowhill, Putnoe, Bedford MK41 8EQ, UK. Fidonet: 2:2500/167.15 Internet: gnome@martinac.demon.co.uk