home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS 1992 September
/
Simtel20_Sept92.cdr
/
msdos
/
catalog
/
catdisk.arc
/
CATDISK.DOC
< prev
next >
Wrap
Text File
|
1987-11-24
|
20KB
|
356 lines
CATDISK Page 1
CATDISK.ARC contains two skeleton databases, several report definitions,
and a supplementary program which will help you create and maintain a catalog
of diskettes and their contents using PC-FILE+, the User Supported database
program from Buttonware, Inc.
The skeleton databases have "smart-key" definitions which add entries cre-
ated by the CATDISK.EXE program to the database and write various reports and
special table of contents files. In addition to the reports PC-FILE+ can pro-
duce, you can also use the program QDRSUM, found as QDRSUM.ARC in the data li-
brary of COMPUSERV's IBMSW SIG, to create report listings for the databases.
The documentation for QDRSUM gives some examples using CATDISK's databases.
The file information database, CATALOG, has fields for the file's name,
its size, creation date, a category (such as Communications or Database), a
brief description of the file's function, and a category group code. This last
field can be used to group a common set of files together under a particular
category. All of the PC-FILE+ files can be grouped this way, as can QMODEM 3.0
files.
The disk volume database, VOLCAT, has fields for the diskette's volume la-
bel, diskette type, amount of free space left , and a short description of the
diskette.
Records are originally read into the databases from import files created
by CATDISK.EXE. The CATALOG database data entry screen includes a list of sug-
gested category values. You can tailor the screen to your own preference. If
you modify a record, you must enter the full value for CATEGORY, as there is no
way to get PC-FILE+ to fill it out for you. You can use SUPERKEY, or a similar
program, to simplify the data entry.
The program CATDISK.EXE reads a diskette's volume label and root direc-
tory. If a diskette has no volume label, you are prompted to provide one,
which is written to the diskette. CATDISK writes an import data file for the
CATALOG database giving file name, creation date, file size, and diskette vol-
ume label for each entry in the directory. It also creates import data for the
VOLCAT database, giving volume label name, diskette type (8 or 9 track, single-
or double-sided, or 1.2MB high density), and amount of free space on the disk-
ette. There are also options to allow CATDISK to update records for the data-
bases for diskettes whose contents have changed. CATDISK has provisions for
noting special files and directories, and uses CATEGORY to indicate them.
If called with no parameters, CATDISK writes import records that match the
CATALOG and VOLCAT database templates. The import file for the CATALOG data-
base is named CATDISK.CAT and the import file for VOLCAT is CATDISK.VOL. The
user can give a different filename to use instead of CATDISK as the first argu-
ment, and can also choose to add records to the end of previously created im-
port files by specifying the /A option.
CATDISK Page 2
The format of the CATALOG import records without an update database is:
[FILE_NAME][DATE][SIZE][VOLNAME][CATEGORY][TIME]
where the TIME field is only written if /T was specified on the call line. The
values for the fields are taken from the root directory of the diskette. The
possible values for CATEGORY are described on page 4. No spaces are written
between field contents, which are blank filled to the following sizes:
Name Size
--------- ----
FILE_NAME 12
DATE 8
SIZE 6
VOL_NAME 11
CATEGORY 10
TIME 5
The format of the VOLCAT import records without an update database is:
[VOL_NAME][FREE_SPACE][DISK_TYPE]
and volume information fields are blank filled to the following sizes:
Name Size
---------- ----
VOL_NAME 11
FREE_SPACE 10
DISK_TYPE 20
The user can have CATDISK update CATALOG and VOLCAT databases, by speci-
fying either one or both of the /U and /V options. CATDISK uses the record
layout given by the databases' .HDR files to construct any import records.
If you so choose, you can change the database layouts, including the names
of the fields. When you do, you have to tell CATDISK what the new names are
for those fields. Use the options shown on page 4 to provide names for any
fields whose names differ from the original templates. CATDISK validates that
the named fields are large enough to hold the related values. The size of each
field can be larger than necessary and the order of the fields can also be
changed.
The next two pages describe how to call CATDISK, and try to explain the
meanings of the arguments. Many of the arguments are only necessary if you
change the names of the databases and/or the names of the fields in the data-
bases. The /U option does not need the optional database name [db], unless the
name for the file information database is other than CATALOG. Similarly, the
/V option needs the [db] only if the volume diskette information database is
not named VOLCAT. For the TIME field, you MUST specify the /T option to have a
time field written, but the [fn] is only needed if its name is not TIME.
CATDISK Page 3
Calling CATDISK.EXE
Call CATDISK with the parameter "?" to get a usage help screen. The
command line for CATDISK is as follows: (square brackets indicate an optional
field)
CATDISK [flnm] [/A] [/U[db]] [/V[db]] [/R] [/Cfn] [/D[fn]] [/Ffn] [/Kfn]
[/Lfn] [/Nfn] [/Sfn] [/T[fn]] [/Mfn] [/Xc]
where:
flnm is a file name to use for the import files. The actual file names
will be flnm.CAT and flnm.VOL. If no file name is specified,
CATDISK is used.
/A indicates to append output to any import file that exists. If /A
is not specified, any existing files are overwritten.
db is a PC-FILE+ database name
fn is a database record field name
/U[db] Update the related databases, and set the file information data-
base name to db--default is CATALOG If a record is found for a
file/volume label pair in the database, the fields for file size,
creation date, (and time if /T is given) are updated. The volume
database will have the free space and type of diskette information
updated for each volume read which has a record in the database
/V[db] Set Update, set volume information database name to db--default is
VOLCAT. Same rules as given under /U apply for updates.
/R Review (show) field definitions, giving location in database rec-
ords, size and full name, as CATDISK reads them from the command
line. This is useful if you want to make sure the correct field
is being used when you use shortened names on the call line
As you can see, all fields are optional. The import files' filename is
defaulted to CATDISK, and no updating is assumed. One of the options /U or /V
must be specified to cause updating. Each option must be separated from the
others by at least one space.
Two update options define what to do when a record is found in the data-
base for a particular file name/volume label pair, and the file is not found on
the dis-kette. If no option is specified, the first field in the record has a
'/' put in its first character, resulting in PC-FILE+ treating it as a deleted
record. If you wish a less drastic action, you can specify:
/Xc the character following X marks a deleted file, put in the first
character of the delete marker field (first field in the database
record, unless the following parameter is used)--default is "/"
/Mfn the named field, fn, is used for the delete mark, rather than the
first field in a database record.
CATDISK Page 4
CATDISK uses the following defaults for database and field names:
Related Default
Option Name Description
------- ---------- ------------------------------------------------
/U CATALOG name of the file information database
/V VOLCAT name of the diskette volume information database
/C CATEGORY name of the category field
/D DATE name of the the file's creation date field
/F FILE_NAME name of the file name field
/L FREE_SPACE name of the diskette's free space left field
/K DISK_TYPE name of the diskette's disk type field (kind)
/N VOL_NAME name of the diskette's volume label name field
/S SIZE name of the file size field
/T TIME name of the file's creation time field
Each of the defaults can be overridden by the related option given in
front of the default. You specify the option with the database or field name
immediately after it--no spaces. The TIME field option MUST be specified for a
time field to be written, but you needn't give the field name, unless it is
other than TIME.
Thus, to indicate that the file information database name is FILES, the
category field is named CLASSIFICATION, and a TIME field is to be written, you
would include the following on the command line:
/UFILES /CCLASSIFICATION /T
The initial value put into the CATEGORY field depends on the nature of
the file found on the diskette. If the file is an "ordinary" file, the
CATEGORY field is left blank. For this discussion, subdirectories are counted
as files, as well. If the file is a directory with no special attributes (Read-
Only, Hidden, or System), it will have "<DIR>" put into its category field.
For files having special attributes, a code indicating the attributes is placed
in angle brackets (<>) for directories, and in colons (:) for regular files.
The following are the possible codes:
RDONLY: Read-Only HIDDEN: Hidden
SYSTEM: System RDNL-HID: Read-Only and Hidden
RDNL-SYS: Read-Only and System HID-SYS: Hidden and System
RO-HI-SY: Read-Only, Hidden, and System
A bootable diskette will have two hidden system files. For MSDOS, their
names could be MSDOS.SYS and MIO.SYS. I have a diagnostics diskette which is
bootable, labeled DIAGNOSTICS. CATDISK wrote the following CATDISK.CAT file:
AUTOEXEC.BAT86-02-05 8DIAGNOSTICS
COMMAND .COM85-11-26 22885DIAGNOSTICS
DIAGX .EXE86-07-04 38342DIAGNOSTICS
ERROR .LOG87-05-17 320DIAGNOSTICS
MIO .SYS85-11-18 9054DIAGNOSTICS:RO-HI-SY:
MSDOS .SYS85-11-18 27856DIAGNOSTICS:RO-HI-SY:
CATDISK Page 5
In order for CATDISK to search the CATALOG database correctly for updated
files, the database must have been sorted with the volume label field specified
as the first (primary) key to SORT. If a diskette is read which has an entry
in the volume catalog database, CATDISK updates the record with the current
diskette type and amount of free space. It then searches the file information
database for records with the same volume label. If no records are found, an
error message "NOT FOUND" is posted, since this should not happen, unless you
have changed the volume label in one of the two databases. The records for all
files still residing on the diskette are updated, and all others are marked as
deleted. Records are written to the import file for all new files found on the
diskette.
For example, to update the databases CATALOG and VOLCAT and write records
for new files and diskettes to files CATDISK.CAT and CATDISK.VOL, use the
following call:
CATDISK /U
To update a database pair whose names are NEWCAT and NEWVOL, where NEWCAT
has a TIME field, write import files NEW.CAT and NEW.VOL, and put the charac-
ter '@' in the field named CAT_GRP for any files found in the database for
a volume being read, but which cannot be found on the diskette, use:
CATDISK NEW /CNEWCAT /VNEWVOL /T /MCAT_GRP /X@
Speaking of volume names, there is one restriction that DOS does not
impose which you should follow, if you intend to use the Table of Contents
report: do not include any dashes (-) in the name. PC-FILE+ attempts to
perform a calculation when a relational lookup is intended. I am unsure
whether to term this a bug, or merely an unfortunate byproduct of the fact I am
using a form that the documentation does not specifically describe: a value
within quotation marks, rather than a field reference.
To create a new diskette file catalog, put all the files from CATDISK.ARC
except the .DOC file on a diskette, or in a directory on your hard disk. If
you have a floppy diskette system, change the default drive to B and place your
CATALOG diskette in drive B. Place a diskette you wish to have catalogued in
the A drive, call CATDISK and specify drive A to it. It will write CATDISK.CAT
and CATDISK.VOL files to your default drive. Continue to insert diskettes and
press the letter of the drive to have CATDISK read more volumes. When finished
feeding diskettes to CATDISK, press RETURN to stop.
If using floppies, change the default drive back to A, place a diskette
with the PC-FILE+ executables and associated .PRO file in drive A, and the
catalog diskette in drive B. You should make the PROfile select drive B for
the databases. For a hard disk, make certain that PC-FILE+'s executable,
PCF.EXE, is located in a directory covered by your PATH statement, and change
to the directory containing the CATALOG and VOLCAT databases. Finally, call
PCF and make certain that it is looking in the right place for the CATALOG
database.
CATDISK Page 6
Choose the CATALOG database for starters, and press the ALT-7 key combi-
nation, that is, press ALT and the 7/& key simultaneously. You are prompted
for an import file name, which is defaulted to CATDISK.CAT. Press RETURN to
use that name. All the file information records are then read into the
database from the CATDISK.CAT file.
When the import is finished, switch over to the diskette volume database
by pressing Q, then D, and select the VOLCAT database. Press ALT-7 to import
the CATDISK.VOL file. After importing the data, you can add a description for
each volume. Once you finish with the diskette descriptions, change back to
CATALOG and add comments to the file records.
The CATALOG database has seven "smart keys" set up. Their specific
functions are as follows:
ALT-1: Sort the database by Category, Category Group, File Name, and Volume
Name. Puts database in the sort order expected by the CATEGORY report
form, used by ALT-2 and ALT-3 keys.
ALT-2: Write a report to CATEGORY.LST, assume database is sorted by Category,
etc. Produce subtotal information per category.
ALT-3: Write two-part report, CATGORY1.LST and CATGORY2.LST, split at Cate-
gory = "Games". The first report has all entries with Category lower
than "Games", the second has the rest. This is useful for my PC Club
library, which has over 4500 entries, and produces a report file lar-
ger than fits on a 362K diskette. Of course, a database this large
only fits on a hard disk or high density diskette. The user can edit
the smart key definition to make the break occur at some other point.
ALT-5: Sort the database by Category, Volume Name, Category Group, and File
Name. This is the order expected by the CATSUM program.
ALT-7: Import file information written by CATDISK.EXE Default import file
name is CATDISK.CAT, but user can enter an alternate name. Just press
RETURN when CATDISK.CAT appears to accept the default.
ALT-8: Sort the database by Volume Name and File Name, as expected by the TOC
report format.
ALT-9: Write a diskette table of contents using the DISKCAT report format.
User is prompted to fill in the complete eleven character Volume Name,
within the quotation marks. After typing the Volume Name, press the
RETURN key, and an output file whose name is the first eight charac-
ters of the Volume Name with a file extension of ".CAT" is written.
Exit PC-FILE+ and copy the file to the diskette with that Volume Name
and you have a table of contents. Make sure that the disk which con-
tains the CATALOG and VOLCAT databases has room for however many of
these table of contents files you plan to create in one PC-FILE+ ses-
sion. If this is unclear, just try it, and look at the file created to
see what a table of contents looks like.
CATDISK Page 7
The VOLCAT database has three "smart keys" set up. Their functions are as
follows:
ALT-1: Sort the VOLCAT database by diskette Volume Label Name.
ALT-2: Write a report file named VOLCAT.LST.
ALT-7: Import file information produced by CATDISK.EXE Default import file
name is CATDISK.VOL, but user can enter an alternate name. Just press
RETURN when CATDISK.VOL appears to accept the default.
NOTE: All of the report output files whose name have an extension of ".LST"
are 96 characters wide. You will need to set your printer to elite type mode
to print on a standard 80 column printer. The program ELITE.COM will cause an
Epson or IBM graphics printer to use elite type (12 characters per inch). The
file PICA.COM puts the same printers into 10 characters per inch mode.
These files are supplied at no charge to all interested parties. The only
reservation is that you may not use these files for a commercial profit. The
name PC-FILE+ is a trademark of ButtonWare, Inc.
Archie Strong
1690 Peachtree Lane
Norristown, PA 19403
COMPUSERV USERID: 73167,1205