The Accessory Version 1.0 Written by: Daniel H. McKee 14A Elm St. Mt. Home AFB, ID 83648 1-208-832-4504 Genie - D.M. Compuserve - 75766,1515 Delphi - ELMAC Source code written in TDI's Modula-2 If you find this accessory or the source code useful, a contribution would be appreciated. Any comments, improvements, or bugs of the accessory, please pass them on to me. Overview Sometimes during the course of an GEM program, for instance, word processing, there may be a need to format a disk or do some file erasing and copying. If there is no desk top functions, then you had to save your work, exit the program, and then run the program again. With this accessory you will be able to format that disk, save or erase that file, and a host of other desk top functions. Accessory features With this accessory you can go the following functions: - Disk format - Copy files - Erase files - Disk copy - Create a folder - Erase a folder - Get disk free space - Print a file directory - Rename a file - Set file attributes - Set write verify Installation Copy the files below to your boot disk. If you have a hard drive, copy the files to drive C. THEACC.ACC - the desk accessory THEACCC.RSC - color resource file THEACCM.RSC - monochrome resource file If you do not put the resource file on the boot disk, then this accessory will not run! The menu item for the accessory will be there and if you click on it, an alert box will indicate that the resource was not loaded. This accessory will run on a 520 or 1040 ST in medium or high resolution. It will not run in low resolution, if however you try to run this accessory in low resolution, an alert box will indicate that the accessory will not operate. Using the accessory To use this accessory select the menu item called The Accessory. The accessory will open up and present all the features that are available. The large dialog on the left side of the accessory is used for a file directory, more about this later. The dialog label FILE INFO is where you can rename and set the file attributes. To the right FILE INFO is the dialog for formatting a disk. Below the format dialog box, is the dialog to do file and disk copying. Also, directly below that is the button to erase files. To the left of the Copy Options is another dialog to erase and create folders. To exit the accessory, click with the mouse arrow on the DONE button or simple press the RETURN key. The file directory This section of the accessory is used to display the files of a selected drive, get the free space(the remaining bytes left on a disk), and print out a hard copy of a selected path. The directory is similar in the use to the Item Selector use in many GEM programs. The directory will display up to twelve files at a time. A folder will be indicated with a graphic character(CHR(5)) at the beginning of the name. Scrolling the file directory is accomplished in the same manner as the standard item selector. Use the up or down arrows to scroll one line, use the track to scroll a page, or click on the slider and drag it to the desired position. To select a file name, simply move the mouse to the displayed file names and click with the left mouse button. As you continue to hold down the left mouse button and move the mouse in the area of the displayed files, the file name will be deselected and selected. Also, the current selected file will displayed next to the files under the Selection. If you click on a folder, it will open up and the contents will be displayed. Now, to close up the folder can be accomplished two ways. First, move the mouse up to the top of the displayed files and click on the long box that displays the current path, this will return you to the previous selected path. Second, Click the mouse on the current selected drive, this will return you to the root directory. The directory also will give you what drives are available on your system. There is a possibility of 16 drives, if you have a hard disk or a ram disk, these will be accessible with this accessory. To change to another drive, simple click with the mouse on the desired drive and the contents will be displayed. Another feature of the directory is getting the free space remaining on a disk. Click with the mouse on BYTES REMAINING button and the space available of the current selected drive will be displayed. To find the free space on other drives, select one of the available drives and click on the BYTES REMAINING again. The finally option available in the directory is printing a hard copy of your files. There is two printing options available. The first one is called ONE ACROSS This will print one file per line with the file name, date, time, and size information. The second option, THREE ACROSS will only print out the file name and size, but three file names and sizes on one line. Whatever option that is decide on, the print out will be of the selected path that is displayed in the long box just above the displayed files. Also, the print out will include the selected path, how many bytes use in that path, and the bytes remaining on the disk. To print, click with the mouse on the PRINT button. If you forget to turn on your printer, or there is some other problem after you click on the print button, an Alert dialog will indicate this condition. Renaming and setting file attributes This option allow you to rename a file and set the file attributes. To use this option, select a file name from the directory. The desired name will be displayed under the Selection box. Once this is accomplished, move the mouse up to the dialog that is named FILE INFO and click on that button. The file name will be displayed along with the size, date, and time. Also, the file attributes will be indicated, the R/O means the file is read only and R/W shows the file is read or write To rename a file, move the cursor up to the file name, either use the arrow keys or mouse to move the cursor, then use the back space, delete, etc.. to edit the file name. Once this is done then press the SET button to rename the file. If you just want to reset the file attributes, simple select the desire button and click on the SET button. If a file has a R/O attribute, you must first set the file attribute to R/W before a file can be renamed. Formatting a disk Next to the FILE INFO is the dialog to format a disk. To format a disk, select the desired drive by clicking on A for drive A or B for drive B. Next select the one of the buttons below the drive selection. The S button is for single sided format and the D button is for double sided format. Another option allows for two different formats. The default the standard format that is you get from GEM Desk Top. This gives you approximately 357,000 bytes for single sided and 726,000 bytes for double sided. The optional format available with this accessory allows for approximately 408,000 bytes for single sided and 828,000 bytes for double sided. To change to the optional format, press the button that displays 9/80 This will change to a 10/80 indicating the optional format. The 9/80 means that there will be nine sectors per track and 80 tracks and the 10/82 means ten sectors per track with 82 tracks. Once the desired drive, sides, and format is selected, then click with the mouse on the FORMAT button to start the formatting process. After the FORMAT button is clicked on, another dialog will be displayed to confirm that you wish to continue. At this point you can cancel by simply pressing the RETURN key or click on the OK button to format. The formatting will actually start after the OK button is pressed and the status of the formatting will be displayed in the format dialog. Creating and erasing folders Below the FILE INFO is the dialog to erase and create folders. To erase a folder, move the mouse to the ERASE button, located in the FOLDERS dialog, and click on it. This will select the button. Next type in the folder name in the directory dialog under the Selection box. Once that is done, click on the OK button in the FOLDERS dialog. To create a new folder is the same process as erasing a folder, the only exception is to click with the mouse on the CREATE button. limitations - If a folder that is to be erased has another folder inside of the root folder, then the root folder will not be erased. You must first erase the folder that is inside of the root folder before the root folder will be erased. For example, inside of a folder named FOLDER1 is FOLDER2 and several other files. If you erase FOLDER1, only the files inside of FOLDER1 will be erased and not FOLDER2. You have to erase FOLDER2 first before FOLDER1 will be abled to be deleted. Copying files This option allows you to copy a file or a group of files. To copy a single file, move the mouse to the COPY OPTIONS dialog and click on the FILE button. Next move the mouse over to the directory and select a file that you want to copy. Now you may select any drive or open up a folder to find the desired source file. Once the source file is selected, move the mouse back to the COPY OPTIONS and click on the DESTINATION button. Next move the mouse back to the directory and select the desired drive or path. As in selecting the source path, you can select any drive or path that is available on your system. To copy the file, move the mouse back to the COPY OPTIONS and press with the mouse on the COPY button. Copying a group of files is done in the same manner as a single file except you can use wild cards to specify the desired files to copy. For example, if you wanted to copy all the files from drive A to drive B, simply type in under the Selection box the wild card option: *.*, or to copy only the file names with a .DOC extender type in: *.DOC. You can a specific group of files. For example, if you had several file named, CHANGE1.DOC, CHANGE2.DOC, CHANGE3.DOC, you can specify: CHANGE*.*, CHA*.*, etc... and all three files will be copied. If you wish to cancel the copy operation before the actual copying starts, click with the mouse on the CANCEL button in the COPY OPTIONS dialog. If you have pressed the COPY button, there still another chance to cancel the copy operation. If you have selected to confirm your file copying, a dialog will be display with the number of files to copy before the actual copying starts. At this point you can cancel or continue with copying( See Set Preferences ). Once the copy process is complete, the copied files will be displayed in the destination directory and the bytes remaining will be displayed showing how much room is left on the disk after copying. If during the copying process a duplicate file encountered, there will be a dialog that will appear over the COPY OPTIONS dialog to indicate this. At this point you have the option of replacing the destination name, renaming, and canceling. The default button is the OK button, if you press the RETURN key the copy process will continue, to cancel, click with the mouse on the CANCEL button. limitations - if you specify to copy all the files in the root directory, ie, A:\*.*, all the files except for folders will copied. Set Preferences The purpose of this option is to verify the operations of copying and erasing files. This is quite similar to the GEM Desk Top's Set Preferences. The default for this option is to verify both copying and erasing of files. To change the default, move the mouse to the COPY OPTIONS dialog and click with the mouse on the OPTIONS button. Another dialog will appear will the options to confirm copies and deletes. Click on the desired options and press the return key or press with the mouse on the OK button. If you wish to cancel, click the CANCEL button and the options that were presented when the SET PREFERENCES dialog opened up will return to those values. Erasing a file This option allows you to erase a single file or a group of files. The first thing is to select a file from the directory, then move the mouse down to the ERASE button. To erase a group of files, type in the desired wild card, ie, *.* for all files or *.DOC to erase just the files with the .DOC extender. Also, as in copying files, you can specify a particular group of files to erase. For Example, to erase the files, CHANGE1, CHANGE2, CHANGE3, type in CHANGE*.*, CHA*.*, etc... and all three files will be erased. As in copying files, you can change to any drive or path to find the file(s) to erase. If the YES button is selected for confirming deleting files, a dialog box will appear before the erasing of the files start. The default here is to cancel the operation, pressing the return key will cancel the process. To erase, click with the mouse on the OK button. limitations - if you specify to erase all the files in the root directory, ie, A:\*.*, all the files except for folders will erased. Disk copy With this option you can copy the contents of floppy disk to another floppy disk. To use this option, move the mouse to the COPY OPTIONS dialog and click with the mouse on the DISK button, then click on the COPY button. Another dialog will appear will the disk copy options. Select whether you want to copy from drive A to drive B, or from drive B to drive A. Next, click with the mouse on the OK button. The disk copying process will start now. If the disk formats are not compatible, the copying will stop. To exit disk copy, press the RETURN key or click with the mouse on the EXIT button This disk copy option should copy any disk no matter what the disk format is. Write verify The purpose for turning off the write verify is to speed up the file copy writing process. Move the mouse to the COPY OPTIONS and click with the mouse on the button indicated by either WRITE VERIFY OFF or WRITE VERIFY ON This will toggle the option on or off.