DiskInfo Version 1.13 Written by Gregg Giles 17 November 1991 Security Leak Publications 3330 Kinsrow Avenue 217, Eugene, OR 97401, USA. BIX: ggiles AmigaX: 503/342-2144 Amigalectric: 912/922-5655 This program is public domain. Spread it at will - populate the world! Donations and contributions will be accepted, but are not demanded. Suggestions and ideas are always welcomed! *************************************************************************** *** Purpose *** *************************************************************************** DiskInfo is a tool which can be used to display information about any Amiga storage media, including disks, hard disks and memory. Eventually it will be worthy of completely replacing the Workbench "Info" command. It can be executed as an AmigaDOS command from the Workbench or Shell. *************************************************************************** *** Requirements *** *************************************************************************** For this program to operate properly, you must have the following: (*) An Amiga (any model) (*) Workbench 2.04 (*) A working knowledge of the Workbench and Shell environments (*) This program *************************************************************************** *** Usage *** *************************************************************************** This program may be executed from the Workbench using the "Workbench/ Execute Command..." option, or from the Shell. Usage is the same from either environment: DiskInfo The "", of course, is the name of any storage device or volume. Further arguments are not present in this version of the program. If no device is specified, the following will be displayed: DiskInfo (Version 1.13) by Gregg Giles Purpose: Gives a complete status report on any mounted AmigaDOS device. Usage : DiskInfo *************************************************************************** *** Usage Examples *** *************************************************************************** These examples assume that you have booted from your Workbench 2.04 distribution disk, and your Extras disk is in DF1:. Issue this command: 1> DiskInfo DF0: Most information of interest to the average user will be displayed, and will appear like this (or similar to it): Name : Workbench2.0: Errors : 0 Bytes Blocks Status: Write Protected Full : 94 % Size: 857904 1758 Type : AmigaDOS OFS In Unit: 0 Used: 808128 1656 Block : 488 bytes In Use : Yes Free: 49776 102 Issuing the following command will show what resides on the Extras disk: 1> DiskInfo DF1: Something similar to the following will appear: Name : Extras2.0: Errors : 0 Bytes Blocks Status: Write Protected Full : 84 % Size: 857904 1758 Type : AmigaDOS OFS In Unit: 1 Used: 726144 1488 Block : 488 bytes In Use : Yes Free: 131760 270 This, of course, is assuming that no errors occur. Further explanation of each field can be found later in this document. Other examples of using DiskInfo include: Command Description ---------------------------------------------------------------------------- DiskInfo DF0: Shows information about disk in unit 0 (DF0:) DiskInfo DF1: Shows information about disk in unit 1 (DF1:) DiskInfo DF2: Shows information about disk in unit 2 (DF2:) DiskInfo DF3: Shows information about disk in unit 3 (DF3:) DiskInfo DH0: Shows information about hard disk partition DH0: DiskInfo DH1: Shows information about hard disk partition DH1: DiskInfo RAM: Shows information about the RAM: disk DiskInfo RAD: Shows information about the RAD: disk DiskInfo Extras2.0: Shows information about a volume named "Extras2.0" DiskInfo Pictures1: Shows information about a volume name "Pictures1" Logical devices created using the "Assign" command may be used in place of a physical storage device (ie: "c:", "libs:", "devs:", etc.) However, in such cases, information about the physical media on which that logical device resides will be displayed. For example, assuming you booted from your Workbench 2.04 distribution disk, use this command and view the ensuing results: 1> DiskInfo C: Name : Workbench2.0:C Errors : 0 Bytes Blocks Status: Write Protected Full : 94 % Size: 857904 1758 Type : AmigaDOS OFS In Unit: 0 Used: 808128 1656 Block : 488 bytes In Use : Yes Free: 49776 102 Notice that the "name" field gives the complete path to the logical device specified. *************************************************************************** *** Explanation of Fields *** *************************************************************************** The program displays rougly a dozen fields when executed (assuming there are no errors). They are described as follows. Field : NAME Purpose : Name of the disk (or volume) being examined. Output : A valid Amiga disk name. If a logical device name is given, a full path name will be displayed. Field : STATUS Purpose : Physical status of the disk. Output : Possible results include: "Write Protected": Disk is write protected. (Formerly "Read Only" in program versions). "Validating": The disk's structure has been corrupted, and AmigaDOS is attempting to correct the problem. "Validated (Writable)": The disk's structure is stable, and thus can be written to or read from. (Formerly "Read/Write" in earlier program versions). "Unknown": The disk's status cannot be determined. Field : TYPE Purpose : Type of disk. Output : Possible results include: "AmigaDOS OFS": A standard AmigaDOS OFS disk (Old File System). All disks formatted using "Format" command under Workbench 1.0-1.3 were OFS format disks (Workbench 2.0 will read/write/format OFS disks.) "AmigaDOS FFS": A standard AmigaDOS FFS disk (Fast File System). Most likely a disk created using the "Format" command under Workbench 2.00 and later versions. "Unknown (????)": The format of the disk cannot be determined. Possibly a disk format not known about at the time of the creation of this program. Note: Subsequent versions of this program may be able to recognize the following disk types: BAD (unreadable/corrupted), KICK (Amiga Kickstart disk), NDOS (Format of the disk is good, but it does not use any known AmigaDOS format; possibly a proprietary file format such as those often used as copy protection for games). Field : BLOCK Purpose : The number of bytes that compose one block on the disk. Output : A positive numeric value. Field : ERRORS Purpose : Number of read/write errors on the disk. Output : A positive numeric value. Field : FULL Purpose : Percentage of the disk which is full. Output : A positive numeric percentage (rounded off). Field : IN UNIT Purpose : AmigaDOS unit number in which the disk resides. Output : Possible results include: -1: The RAM: device 0 : Floppy disk DF0: 1 : Floppy disk DF1: 2 : Floppy disk DF2: x : Any unknown unit number, where (x) is the number of that unit. (Note: Some hard disk partitions may appear as unit 0.) Field : IN USE Purpose : Message telling if the disk is currently in use. Output : Possible results include: "Yes": The disk is in use. "No" : The disk is not in use. Field : SIZE (BYTES) Purpose : Total byte storage capacity of the disk. Output : A positive numeric value. Note that this is the total actual storage possible. The Amiga file system will reduce the total available free storage space. Field : SIZE (BLOCKS) Purpose : Total block storage capacity of the disk. Output : A positive numeric value. Field : USED (BYTES) Purpose : Number of bytes of the disk which have been used. Output : A positive numeric value. Field : USED (BLOCKS) Purpose : Number of blocks of the disk which have been used. Output : A positive numeric value. Field : FREE (BYTES) Purpose : Number of bytes of the disk which are not yet used. Output : A positive numeric value. Field : FREE (BLOCKS) Purpose : Number of blocks of the disk which are not yet used. Output : A positive numeric value. *************************************************************************** *** Program Integrity & Bugs *** *************************************************************************** It is the author's goal to keep this program as stable, correct, and as bug-free as possible. For this reason it employs careful error checking techniques, particularly when dealing with locks and memory. Everything which is opened is closed, even when errors occur. As an Amiga user himself, the author loves cleanly written programs, particularly those that don't suck up system resources when they screw up. This program has its own built-in error messages, and all are largely self-explanitory. These error messages generally only appear when the user has done something incorrectly (ie: trying to examine a disk in a drive when no disk is present). However, should you discover any bugs in this program, please record them and contact me immediately so that they may be corrected and the fixed version of the program released. *************************************************************************** *** Revisions & Planned Enhancements *** *************************************************************************** Planned Enhancements: * Wildcards, including the AmigaDOS wildcard combination (#?) and the well-liked asterisk (*) familiar to UNIX, MS-DOS, and Amiga ARP users. * Enable recognition of disk formats other than AmigaDOS. * Enable display of all mounted devices simultaneously, much like the AmigaDOS Info command when used with no flags. The following changes have been made to this program since the previous version: * Now using official 2.04 #defines for return codes instead of self-defined return codes of 1.12. Makes program a little smaller. * Device lock changed from ACCESS_READ to new synonomous SHARED_LOCK. * Error checking code streamlined. Makes program a little smaller. * Error messages improved; now use Workbench 2.04 messages from IoErr(). * Breaking with Control-C is now impossible; prevents dangerous situations. *EOF*