DSKXTRCT and DSKCOMPR - Version 1.1 - 3/3/1998
Copyright 1997, 1998 by Alan B. Arnett
Contact: Alan.Arnett@ibm.net


Table of Contents

1. Description
2. Special Notes and Restrictions
3. General Notes
4. Program Operation and Usage
5. Future Considerations
6. Credits and Appreciations
7. Package contents
8. Copyright and Disclaimers


1. Description

The DSKXTRCT and DSKCOMPR programs work with DSK diskette image
files associated with the IBM programs, SAVEDSKF and LOADDSKF.
(See notes below for a brief explanation of the SAVEDSKF and
LOADDSKF utilities.)

DSKXTRCT extracts the original files from DSK files into a
subdirectory, avoiding the need to recreate diskettes. This is
useful if the desire is to copy the original files onto a hard
drive without creating intermediate diskettes.  One of the major
purposes for DSKXTRCT is to create a hard drive subdirectory
directly from IBM fixpak DSK files that can be used to apply the
fixpak, bypassing the creation of diskettes.

DSKCOMPR compares the files in DSK files to a target subdirectory
or diskette. This is useful for verifying that LOADDSKF correctly
created the diskette.  The compare of a DSK file to a diskette is
a case where DSKCOMPR fills a need not satisfied by LOADDSKF.


2. Special Notes and Restrictions

Duplicate CSF_DSK files (and other files) with DSKXTRCT: When
using DSKXTRCT to create a single directory from multiple DSK
files, duplicate files will not be replaced without the user's
permission, either by command line option or screen prompt.  Be
aware that IBM fixpak diskette images frequently contain a file
identifying the diskette name and number.  This file may be named
the same on each diskette image, as an example: "CSF_DISK".  If
one of the command options to replace or skip all duplicates is
not used, the user will be prompted for each attempt to replace
this file.  The user may respond to each duplicate file, or at
anytime, choose to replace or skip any further duplicate files. 
Note that in the creation of a subdirectory for fixpak files,
DSKXTRCT emulates the process of creating diskettes and then
performing an XCOPY to a subdirectory with the '/s' parameter in
which all needed subdirectories would be created and any
duplicate files would be overwritten.

Duplicate CSF_DSK files (and other files) with DSKCOMPR: When
using DSKCOMPR to compare multiple DSK files to a single
directory, duplicate files that have been replaced or skipped
will show as errors.  These mismatched files may not be a concern
if the DSK files are IBM fixpak files.  See the above description
of "Duplicate CSF_DISK files with DSKXTRCT". 

While DSKXTRCT can extract the DSK files to a diskette, this is
individual file level operation.  Any diskette internal data such
as boot records, reserved fields or other nonstandard diskette
attributes not directly contained within a normal file will not
be handled.  LOADDSKF is better/faster/safer for creating
diskettes.  Once the diskette has been recreated, DSKCOMPR can be
used to verify that the diskette has been created correctly.


3. General Notes

DSKXTRCT was written to fulfill two needs.  First, to eliminate
the need to create diskettes from IBM fixpak DSK files.  With
DSKXTRCT, a subdirectory containing the original files can be
created directly from the DSK files and the SERVICE process then
can be changed to use this subdirectory.  Second, to enable the
storage of product diskette backups on large storage media such
as ZIP or SYQUEST drives using the SAVEDSKF program and still
have access to the original files when needed without having to
recreate the diskettes.

DSKCOMPR was written as a companion program, as a result of bbs
exchanges/complaints about diskette errors that sometimes went
undetected when LOADDSKF recreated fixpak diskettes.

Neither DSKXTRCT nor DSKCOMPR can process a DSK file that has
been created by SAVEDSKF using the compression option.  This
doesn't seem to be a serious restriction as all the DSK files
currently distributed by IBM are created in a non-compressed
format.  This restriction should be kept in mind if the user
wants to use SAVEDSKF to create personal DSK files from
diskettes.

DSKXTRCT and DSKCOMPR do not verify the checksum data stored in
the DSK file.  This means that any undetected network
transmission error which corrupts some of the data in a DSK file
will not be detected.  LOADDSKF should detect this error if
diskettes are created.

IBM utilities SAVEDSKF and LOADDSKF: IBM uses these two utilities
for handling correction and device driver diskettes made
available for the users of many of their products. SAVEDSKF reads
a diskette and creates a single file with all the information
needed to recreate an exact copy of the original diskette.
LOADDSKF is used to recreate a diskette from the DSK files. This
SAVEDSKF/LOADDSKF process allows an entire diskette image to be
transferred electronically and recreated by the recipient. These
utilities can be found on many web sites or bulletin boards



4. Program Operation and Usage

Both programs have similar command line parameters. The source
parameter is required for all operations, and the target
parameters is required for operations except 'view file list'.
The other parameters are optional.  If file replace or skipping
parameters are not provided on the command line, the user will be
prompted as needed. Parameters may be specified in any order and
are not case sensitive.

Two general command syntax are provided for each program, the
first for normal operation, and the second for viewing a list of
files contained in the DSK files.

                                                                
DSKXTRCT /s:<mask> /t:<sdir> [/l:<file>] [m:<mode>] [/ra|/rn]
[/lr|/ls|/la] [/c] [/q]
                                                                
DSKXTRCT /s:<mask> /v [/l:<file>] [m:<mode>] [/lr|/ls|/la] [/c]
[/q]

                                                                
DSKCOMPR /s:<mask> /t:<sdir> [/l:<file>] [m:<mode>] [/lr|/ls|/la]
[/c] [/q]
                                                                
DSKCOMPR /s:<mask> /v [/l:<file>] [m:<mode>] [/lr|/ls|/la] [/c]
[/q]


/s:<source file name or mask> - (required) the source file name
or mask of the DSK diskette image files to be extracted or
compared. If a mask is used, the specific directory supplied will
be searched and each DSK image file found will be processed, but
no subdirectory trees will be searched to find more mask files. 
The mask needs to be restrictive enough to bypass non-DSK files,
as these will cause errors and program termination.
                                                                
Example: "/s:c:\storage\os2warp4\xrm005\*.?dk"

/t:<target directory or drive> - (required, except for 'view file
list' operations) the target directory or diskette drive for
processing. During extract processing, this subdirectory and any
additional subdirectories will be created if they do not already
exist. To extract files to the current directory, use "/t:.", but
note that any applicable subdirectory structure defined in the
DSK file will still be created.  
                                                                
Example: "/t:c:\temp\xrm005"

/l:<log file name> - (optional) overrides the default log file
name and may specify a full drive and path qualification.  The
default log file names are dskxtrct.log and dskcompr.log and are
created in the current directory at the time the program is
invoked.  Note this can cause an error if the program is invoked
while the current directory is set to a CD-ROM or a network drive
to which the user is unable to write.
                                                                
Example: "/l:c:\temp\xrm005\mylog.log"

/m:<message level> - (optional) sets control for message output.
Message levels include:
     NONE - suppress all messages except errors and warnings
     STD - print normal messages (default)
     FILES - print the names and file sizes of individual files
as they are created or compared.
                                                                
Example: "/m:files"

/c - (optional) lists any comments contained in the DSK file.

/v - (optional) generates a list of file names and sizes instead
of creating or comparing files. The target parameter is
unnecessary when using this parameter and is ignored if provided.
This parameter provides the same operation in both DSKXTRCT and
DSKCOMPR.

/lr - (optional) replace the log file if a duplicate is found.

/la - (optional) append to the log file if a duplicate is found.

/ls - (optional) skip writing to the log file if a duplicate is
found.

/q - (optional) quiet mode, bypass writing messages to the
screen, if the log file is successfully being used.  This
parameter has no effect if '/ls' is used or if 'skip' was
specified to a 'replace log file' prompt.

/ra - (optional) replace ALL duplicate files found by DSKXTRCT in
the target subdirectory.

/rn - (optional) replace NO duplicate files found by DSKXTRCT in
the target subdirectory.

A return code is used at program completion to indicate the
results of processing and can be tested in command files
(messages should indicate the cause of any warnings or errors):

     0 - successful completion.
     4 - some minor error(s) occurred, ie, a subdirectory wasn't
found during compare.
     8 - a serious but non-terminal error occurred, ie, a file
was not created or did not compare.
     16 - a terminal error occurred, ie, an invalid parameter, or
a system error.

Examples of program execution:

     dskxtrct /s:\fixpacks\xr_m005.?dk /t:\temp\xrm005 /ra
/m:file /lr 

     dskcompr /s:\fixpacks\xr_m005.1dk /t:a: /l:compare1.log


5. Future considerations

While I will entertain suggestions or comments on these programs,
I do not provide any assurances that I will enhance or correct
any of these programs in the future.  This project is done as a
hobby and for fun.  Having said that, the following list contains
points I am considering working on if and when the time and the
mood present themselves.  I will entertain suggestions on the
priority of these items and for other items, but again I reserve
the final right to decide what, if anything, gets done and when. 
Let me know if you found these programs useful.

- add a /fixpak parameter to automate the handling of duplicate
"CSF_DISK" files and possibly override some of the defaults for
this specific condition.

- add to the 'replace/skip' file prompts the option to specify a
different file name or location.

- report skipped and/or replaced files separately from other FILE
level messages.

- add a parameter to make the default log file location the
target directory rather than the current directory. This can be
done now by specifying a fully qualified log file name.

- support checksum verification of DSK files.

- add a parameter to suppress creation of subdirectories defined
in the DSK file so all files are extracted into the target
directory.

- add a parameter to provide a mask for files to be extracted
from the DSK file.

- add support for compressed DSK files.


6. Credits and appreciations

I want to express my appreciation to Frank McKenney for his
testing and for his extensive and valuable suggestions.   Frank's
postings also gave me the idea for the compare program.  I also
want to thank my brother Steve Arnett for his encouragement and
initial testing. 


7. Package contents

This package contains 3 files:
DSKXTRCT.EXE - the extraction program
DSKCOMPR.EXE - the compare program
DSKXTRCT.TXT - this documentation file.


8. Copyright and disclaimers

The DSKXTRCT and DSKCOMPR programs are freeware.  The author
retains the copyright to these programs, but you are free to use
them with the only restrictions that you not reverse engineer
them. Furthermore, you are free to distribute them to anyone
else, as long as all files contained in the package are kept
intact and unmodified and any charge is only for copying and
distribution. 

DSKXTRCT and DSKCOMPR are provided as is.  No warranties or
guaranties, either expressed or implied, are provided that these
programs will function as intended.

The programs LOADDSKF and SAVEDSKF are copyrighted by IBM.



(PLEASE DO NOT DISTRIBUTE ANY BETA FILES YOU MAY FIND ON BULLETIN
BOARDS, CONTACT THE AUTHOR FOR THE LATEST PRODUCTION CODE.)



