home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Dr. CD ROM (Annual Premium Edition)
/
premium.zip
/
premium
/
IBMOS2_2
/
DHRGCD.ZIP
/
DHRGCD.DOC
< prev
next >
Wrap
Text File
|
1992-07-01
|
13KB
|
489 lines
DHRGCD - Global Change Directory Command Version 1.01 for OS/2 2.0
DHRGCD - Global Change Directory Command
Version 1.01
for OS/2 2.0
June 22, 1992
Author - Dennis H. Rosenthal
Description: ____________
The DHRGCD.CMD REXX command file implements a command line direc-
tory change function across all accessible hard disks on your PC.
This is similar to the Peter Norton NCD DOS command (without
graphics) but provides a single index for all hard disks.
To initialize the directory index (DIRINFO.GCD), use -
DHRGCD /r [search_disk_options]
or
DHRGCD /rq [search_disk_options]
The option /r will build the index and display all directories
found. The option /rq will build the index without the display of
directories (quietly). The optional search_disk_options may be
used to override the default of all accessible hard disks known
to OS/2. To build an index only for disks D & E enter -
DHRGCD /rq DE
The /r or /rq option should be used whenever directories are
added or deleted to synchronize the index with the actual cont-
ents of the hard disk.
To jump to another directory on the current disk or on another
disk, just enter the directory name as the first parameter -
DHRGCD dll
will change to the directory ...\...DLL... found on any disk
searched when the index was created. The search for directory
name will only be successful if it appears as part of the last
qualifier of a directory in whole or part. The specification of
DLL will match
\ABC\DEF\DLL1
\ABC\123DLL
\DLL
but not
\DLL1\ABC
1
DHRGCD - Global Change Directory Command Version 1.01 for OS/2 2.0
If multiple destinations are possible, a selection list will be
displayed -
There are multiple possibilities -
1 \ABC\DEF\DLL1
2 \ABC\123DLL
3 \DLL
Enter Selection Number, 0 for No Change, or Just Press Enter
for Item 3
This will be repeated until a number in the range 0 to 3 is
entered. If an exact match is found, it will be used as the
default for the enter key. If multiple exact matches are found,
the last one will be the default for the enter key.
Directories containing spaces may also be matched by using the
double quote (") character around the directory -
DHRGCD "A B C"
To restrict the change to the present disk, use the option
/l
Example -
DHRGCD /l DLL
will show directories that match DLL only on the current disk.
The index file (DIRINFO.GCD) is an ASCII CR/LF delimited file
that may be viewed with any editor. It will contain all directo-
ries that exist on the disks selected for indexing. The index
will be placed in the root directory of the boot disk. The desti-
nation may be changed if desired.
2
DHRGCD - Global Change Directory Command Version 1.01 for OS/2 2.0
Installation: _____________
The file DHRRU100.DLL must be placed in a directory that is
specified in the LIBPATH statement in your CONFIG.SYS. After OS/2
installation the LIBPATH usually contains at least d:\OS2\DLL and
d:\OS2\APPS\DLL (where d: is the installation drive). It may be
placed in either of these directories or any other directory in
the LIBPATH statement.
The file DHRGCD.CMD must be placed in a directory that is speci-
fied in the SET PATH statement in your CONFIG.SYS. After OS/2 in-
stallation the SET PATH usually contains at least d:\OS2 and
d:\OS2\SYSTEM (where d: is the installation drive). It may be
placed in either of these directories or any other directory in
the SET PATH statement.
The file DHRGCD.INF must be placed in a directory that is speci-
fied in the BOOKSHELF statement in your CONFIG.SYS. After OS/2
installation the BOOKSHELF usually contains at least d:\OS2\BOOK
(where d: is the installation drive). It may be placed in that
directory or in another directory by adding the other directory
to your BOOKSHELF statement.
This file, DHRGCD.DOC, may be placed anywhere convenient as it is
not referenced by DHRGCD.CMD.
3
DHRGCD - Global Change Directory Command Version 1.01 for OS/2 2.0
Errors: _______
When an error is detected, messages will be displayed and the CMD
will exit with a non-zero return code. The return codes are -
4 - Help information was displayed
8 - Directory target not found in index
12 - Missing parameters
16 - Invalid option entered
20 - Error changing to directory target - recreate index
24 - No directories found on disk - index file not created
28 - Index file not found - use /r to create index
32 - Error finding DHRRU100 DLL
36 - Error processing DHRRU100 DLL
40 - Error writing to index file
44 - Unable to find a local disk for storage of index file
4
DHRGCD - Global Change Directory Command Version 1.01 for OS/2 2.0
Customization: ______________
The DHRGCD.CMD file is a REXX program file which contains source.
It may be modified with any editor. At the start of the program
are four REXX variables that control how the program operates.
The destination of where the index file will be placed may be
customized by two options. The default is to place the index file
on the boot disk.
The variable
use_current_disk_index
when set to 'Y' will place the index on the disk where the com-
mand is executed. This will allow a separate index for each hard
disk. The CMD file is delivered with this set to 'N'.
If use_current_disk_index is not set to 'Y', the variable
use_boot_disk_index
when set to 'Y' will place the index on the boot disk. If
use_current_disk_index is not 'Y' and use_boot_disk_index is also
not 'Y', the index will be placed on the first local hard disk.
The CMD file is delivered with this set to 'Y'. This option is
provided to allow the containment of all OS/2 files on a single
disk. This CMD was developed on a PC where disk C is a DOS 5 -
OS/2 1.3 dual boot primary partition, disk D is an OS/2 FAT
bootable logical partition, and disk I is an OS/2 HPFS bootable
logical partition on a second physical disk. DHRGCD.CMD will
search disk D for the index file when booted from disk D and
search disk I when booted from disk I.
The DHRGCD.CMD file will use the ANSI.SYS control strings to
adjust display colors. One consequence is that the current colors
cannot be saved. If changed by the CMD the display will be left
with a white foreground on a black background. If this is not
desirable, the use of ANSI control strings may be eliminated by
setting the variable
use_ansi_colors
to 'N'. Or the default exit value (ansi_white) may be changed to
match the colors you are currently using.
The default disks to be indexed are the combination of local hard
disks and remote disks known to OS/2 at the time the index re-
quest is processed. To index only local hard disks, set the value
of variable
use_all_disks
to 'N'.
5
DHRGCD - Global Change Directory Command Version 1.01 for OS/2 2.0
The CMD file may be renamed. One suggestion is to rename
DHRGCD.CMD to GCD.CMD and create a second CMD file called CCD.CMD
(Current disk Change Directory) that invokes GCD.CMD with the
'/l' parameter. This would provide global access with GCD and
current disk only access with CCD. Example -
/* This is a REXX exec */
parse arg dest
if left(dest,1) = '/' then do
say 'Invalid Destination ('dest') - use DHRGCD for options'
exit 16
end
call 'GCD' '/l' dest
exit result
6
DHRGCD - Global Change Directory Command Version 1.01 for OS/2 2.0
Disclaimer: ___________
DHRGCD.CMD and DHRRU100.DLL are distributed as is, with no guar-
antee that they will work correctly in all situations. In no
event will the Author be liable for any damages whatsoever,
including, without limitation, loss of profit, loss of informa-
tion, or special, incidental, or consequential damages or other
similar claims, arising out of the use of or inability to use
these files, even if the Author has been advised of the possibil-
ity of such damages, or for any claim by any other party.
Copyright: __________
The files DHRGCD.CMD and DHRRU100.DLL are placed in the public
domain with the restriction that some parts may have previously
been copyrighted by others. You may use, redistribute, or modify
these files without restriction by the Author.
Modifications: ______________
Since this is a REXX command file, the source is available for
modification by anyone. I would appreciate notification of any
major modifications or corrections so they may be reviewed for
inclusion in future versions (if any).
I may be reached via CompuServe ID 75176,3003.
Dennis H. Rosenthal
June 22, 1992
7
DHRGCD - Global Change Directory Command Version 1.01 for OS/2 2.0
DHRRU100 DLL Notes: ___________________
To determine the OS/2 boot disk, a REXX callable DLL was created
based on the REXXUTIL DLL. It has a single function that returns
the information from the OS/2 2.0 DosQuerySysInfo request. The
DHRGCD.CMD only uses one variable, stem.5, which contains the
boot disk number. A total of 23 variables will be returned along
with descriptions. Example (reminder - '/*' must begin in column
1 on first line of cmd file to invoke REXX processing) -
/* This is a REXX exec */
/*
** Use RxFuncAdd to identify the DLL and register an entry point
*/
if RxFuncQuery('DHRSysInfo') then
call RxFuncAdd 'DHRSysInfo','DHRRU100','DHRSysInfo'
call DHRSysInfo 'infoval', 'infodesc'
/* On return, RESULT will contain "0" or > "0" */
if result > 0 then do
say 'Error in DHRSysInfo, rc =' result
exit result
end
/* infoval.0 contains the count of variables returned */
say 'Count of variables returned =' infoval.0
do varnum = 1 to infoval.0
say left(infodesc.varnum,30) infoval.varnum
end
exit
The call to DHRSysInfo requires one REXX stem variable name and
optionally a second REXX stem variable name. The variable stem.0
will contain the count of data item returned in stem.1 through
stem.n. The first variable name is used to return values. The
second variable name, if supplied, is used to return descriptions
for the values in the first variable. A result code of 0 indi-
cates that the function executed correctly. A result code greater
than zero will indicate a problem with extracting the information
or storing the information in a REXX variable. An error message
will be displayed with more specific information. A parameter
error will produce a severe REXX error and terminate the CMD
file.
8