home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional / OS2PRO194.ISO / os2 / fileutil / dhrgcd / dhrgcd.doc < prev    next >
Encoding:
Text File  |  1992-07-01  |  12.9 KB  |  489 lines

  1.  
  2.         DHRGCD - Global Change Directory Command Version 1.01 for OS/2 2.0
  3.  
  4.  
  5.  
  6.                   DHRGCD - Global Change Directory Command
  7.                            Version 1.01
  8.                            for OS/2 2.0
  9.                            June 22, 1992
  10.                            Author - Dennis H. Rosenthal
  11.  
  12.  
  13.         Description:
  14.         ____________
  15.  
  16.         The DHRGCD.CMD REXX command file implements a command line direc-
  17.         tory change function across all accessible hard disks on your PC.
  18.         This is similar to the Peter Norton NCD DOS command (without
  19.         graphics) but provides a single index for all hard disks.
  20.  
  21.         To initialize the directory index (DIRINFO.GCD), use -
  22.  
  23.         DHRGCD /r [search_disk_options]
  24.            or
  25.         DHRGCD /rq [search_disk_options]
  26.  
  27.         The option /r will build the index and display all directories
  28.         found. The option /rq will build the index without the display of
  29.         directories (quietly). The optional search_disk_options may be
  30.         used to override the default of all accessible hard disks known
  31.         to OS/2. To build an index only for disks D & E enter -
  32.  
  33.         DHRGCD /rq DE
  34.  
  35.         The /r or /rq option should be used whenever directories are
  36.         added or deleted to synchronize the index with the actual cont-
  37.         ents of the hard disk.
  38.  
  39.  
  40.         To jump to another directory on the current disk or on another
  41.         disk, just enter the directory name as the first parameter -
  42.  
  43.         DHRGCD dll
  44.  
  45.         will change to the directory ...\...DLL... found on any disk
  46.         searched when the index was created. The search for directory
  47.         name will only be successful if it appears as part of the last
  48.         qualifier of a directory in whole or part. The specification of
  49.         DLL will match
  50.  
  51.            \ABC\DEF\DLL1
  52.            \ABC\123DLL
  53.            \DLL
  54.  
  55.         but not
  56.  
  57.            \DLL1\ABC
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                         1
  64.  
  65.         DHRGCD - Global Change Directory Command Version 1.01 for OS/2 2.0
  66.  
  67.  
  68.         If multiple destinations are possible, a selection list will be
  69.         displayed -
  70.  
  71.            There are multiple possibilities -
  72.             1 \ABC\DEF\DLL1
  73.             2 \ABC\123DLL
  74.             3 \DLL
  75.            Enter Selection Number, 0 for No Change, or Just Press Enter
  76.         for Item 3
  77.  
  78.         This will be repeated until a number in the range 0 to 3 is
  79.         entered. If an exact match is found, it will be used as the
  80.         default for the enter key. If multiple exact matches are found,
  81.         the last one will be the default for the enter key.
  82.  
  83.  
  84.         Directories containing spaces may also be matched by using the
  85.         double quote (") character around the directory -
  86.  
  87.            DHRGCD "A B C"
  88.  
  89.  
  90.         To restrict the change to the present disk, use the option
  91.           /l
  92.  
  93.         Example -
  94.           DHRGCD /l DLL
  95.  
  96.         will show directories that match DLL only on the current disk.
  97.  
  98.  
  99.         The index file (DIRINFO.GCD) is an ASCII CR/LF delimited file
  100.         that may be viewed with any editor. It will contain all directo-
  101.         ries that exist on the disks selected for indexing. The index
  102.         will be placed in the root directory of the boot disk. The desti-
  103.         nation may be changed if desired.
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.                                         2
  126.  
  127.         DHRGCD - Global Change Directory Command Version 1.01 for OS/2 2.0
  128.  
  129.  
  130.  
  131.         Installation:
  132.         _____________
  133.  
  134.         The file DHRRU100.DLL must be placed in a directory that is
  135.         specified in the LIBPATH statement in your CONFIG.SYS. After OS/2
  136.         installation the LIBPATH usually contains at least d:\OS2\DLL and
  137.         d:\OS2\APPS\DLL (where d: is the installation drive). It may be
  138.         placed in either of these directories or any other directory in
  139.         the LIBPATH statement.
  140.  
  141.         The file DHRGCD.CMD must be placed in a directory that is speci-
  142.         fied in the SET PATH statement in your CONFIG.SYS. After OS/2 in-
  143.         stallation the SET PATH usually contains at least d:\OS2 and
  144.         d:\OS2\SYSTEM (where d: is the installation drive). It may be
  145.         placed in either of these directories or any other directory in
  146.         the SET PATH statement.
  147.  
  148.         The file DHRGCD.INF must be placed in a directory that is speci-
  149.         fied in the BOOKSHELF statement in your CONFIG.SYS. After OS/2
  150.         installation the BOOKSHELF usually contains at least d:\OS2\BOOK
  151.         (where d: is the installation drive). It may be placed in that
  152.         directory or in another directory by adding the other directory
  153.         to your BOOKSHELF statement.
  154.  
  155.         This file, DHRGCD.DOC, may be placed anywhere convenient as it is
  156.         not referenced by DHRGCD.CMD.
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.                                         3
  189.  
  190.         DHRGCD - Global Change Directory Command Version 1.01 for OS/2 2.0
  191.  
  192.  
  193.  
  194.         Errors:
  195.         _______
  196.  
  197.         When an error is detected, messages will be displayed and the CMD
  198.         will exit with a non-zero return code. The return codes are -
  199.  
  200.            4 - Help information was displayed
  201.  
  202.            8 - Directory target not found in index
  203.  
  204.           12 - Missing parameters
  205.  
  206.           16 - Invalid option entered
  207.  
  208.           20 - Error changing to directory target - recreate index
  209.  
  210.           24 - No directories found on disk - index file not created
  211.  
  212.           28 - Index file not found - use /r to create index
  213.  
  214.           32 - Error finding DHRRU100 DLL
  215.  
  216.           36 - Error processing DHRRU100 DLL
  217.  
  218.           40 - Error writing to index file
  219.  
  220.           44 - Unable to find a local disk for storage of index file
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.                                         4
  252.  
  253.         DHRGCD - Global Change Directory Command Version 1.01 for OS/2 2.0
  254.  
  255.  
  256.  
  257.         Customization:
  258.         ______________
  259.  
  260.         The DHRGCD.CMD file is a REXX program file which contains source.
  261.         It may be modified with any editor. At the start of the program
  262.         are four REXX variables that control how the program operates.
  263.         The destination of where the index file will be placed may be
  264.         customized by two options. The default is to place the index file
  265.         on the boot disk.
  266.  
  267.         The variable
  268.            use_current_disk_index
  269.         when set to 'Y' will place the index on the disk where the com-
  270.         mand is executed. This will allow a separate index for each hard
  271.         disk. The CMD file is delivered with this set to 'N'.
  272.  
  273.         If use_current_disk_index is not set to 'Y', the variable
  274.            use_boot_disk_index
  275.         when set to 'Y' will place the index on the boot disk. If
  276.         use_current_disk_index is not 'Y' and use_boot_disk_index is also
  277.         not 'Y', the index will be placed on the first local hard disk.
  278.         The CMD file is delivered with this set to 'Y'. This option is
  279.         provided to allow the containment of all OS/2 files on a single
  280.         disk. This CMD was developed on a PC where disk C is a DOS 5 -
  281.         OS/2 1.3 dual boot primary partition, disk D is an OS/2 FAT
  282.         bootable logical partition, and disk I is an OS/2 HPFS bootable
  283.         logical partition on a second physical disk. DHRGCD.CMD will
  284.         search disk D for the index file when booted from disk D and
  285.         search disk I when booted from disk I.
  286.  
  287.         The DHRGCD.CMD file will use the ANSI.SYS control strings to
  288.         adjust display colors. One consequence is that the current colors
  289.         cannot be saved. If changed by the CMD the display will be left
  290.         with a white foreground on a black background. If this is not
  291.         desirable, the use of ANSI control strings may be eliminated by
  292.         setting the variable
  293.            use_ansi_colors
  294.         to 'N'. Or the default exit value (ansi_white) may be changed to
  295.         match the colors you are currently using.
  296.  
  297.         The default disks to be indexed are the combination of local hard
  298.         disks and remote disks known to OS/2 at the time the index re-
  299.         quest is processed. To index only local hard disks, set the value
  300.         of variable
  301.            use_all_disks
  302.         to 'N'.
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.                                         5
  315.  
  316.         DHRGCD - Global Change Directory Command Version 1.01 for OS/2 2.0
  317.  
  318.  
  319.         The CMD file may be renamed. One suggestion is to rename
  320.         DHRGCD.CMD to GCD.CMD and create a second CMD file called CCD.CMD
  321.         (Current disk Change Directory) that invokes GCD.CMD with the
  322.         '/l' parameter. This would provide global access with GCD and
  323.         current disk only access with CCD. Example -
  324.  
  325.         /* This is a REXX exec */
  326.         parse arg dest
  327.         if left(dest,1) = '/' then do
  328.             say 'Invalid Destination ('dest') - use DHRGCD for options'
  329.             exit 16
  330.         end
  331.         call 'GCD' '/l' dest
  332.         exit result
  333.  
  334.  
  335.  
  336.  
  337.  
  338.  
  339.  
  340.  
  341.  
  342.  
  343.  
  344.  
  345.  
  346.  
  347.  
  348.  
  349.  
  350.  
  351.  
  352.  
  353.  
  354.  
  355.  
  356.  
  357.  
  358.  
  359.  
  360.  
  361.  
  362.  
  363.  
  364.  
  365.  
  366.  
  367.  
  368.  
  369.  
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.                                         6
  377.  
  378.         DHRGCD - Global Change Directory Command Version 1.01 for OS/2 2.0
  379.  
  380.  
  381.  
  382.         Disclaimer:
  383.         ___________
  384.  
  385.         DHRGCD.CMD and DHRRU100.DLL are distributed as is, with no guar-
  386.         antee that they will work correctly in all situations.  In no
  387.         event will the Author be liable for any damages whatsoever,
  388.         including, without limitation, loss of profit, loss of informa-
  389.         tion, or special, incidental, or consequential damages or other
  390.         similar claims, arising out of the use of or inability to use
  391.         these files, even if the Author has been advised of the possibil-
  392.         ity of such damages, or for any claim by any other party.
  393.  
  394.  
  395.         Copyright:
  396.         __________
  397.  
  398.         The files DHRGCD.CMD and DHRRU100.DLL are placed in the public
  399.         domain with the restriction that some parts may have previously
  400.         been copyrighted by others. You may use, redistribute, or modify
  401.         these files without restriction by the Author.
  402.  
  403.  
  404.         Modifications:
  405.         ______________
  406.  
  407.         Since this is a REXX command file, the source is available for
  408.         modification by anyone. I would appreciate notification of any
  409.         major modifications or corrections so they may be reviewed for
  410.         inclusion in future versions (if any).
  411.  
  412.         I may be reached via CompuServe ID 75176,3003.
  413.  
  414.         Dennis H. Rosenthal
  415.         June 22, 1992
  416.  
  417.  
  418.  
  419.  
  420.  
  421.  
  422.  
  423.  
  424.  
  425.  
  426.  
  427.  
  428.  
  429.  
  430.  
  431.  
  432.  
  433.  
  434.  
  435.  
  436.  
  437.  
  438.  
  439.  
  440.  
  441.                                         7
  442.  
  443.         DHRGCD - Global Change Directory Command Version 1.01 for OS/2 2.0
  444.  
  445.  
  446.         DHRRU100 DLL Notes:
  447.         ___________________
  448.  
  449.         To determine the OS/2 boot disk, a REXX callable DLL was created
  450.         based on the REXXUTIL DLL. It has a single function that returns
  451.         the information from the OS/2 2.0 DosQuerySysInfo request. The
  452.         DHRGCD.CMD only uses one variable, stem.5, which contains the
  453.         boot disk number. A total of 23 variables will be returned along
  454.         with descriptions. Example (reminder - '/*' must begin in column
  455.         1 on first line of cmd file to invoke REXX processing) -
  456.  
  457.         /* This is a REXX exec */
  458.         /*
  459.         ** Use RxFuncAdd to identify the DLL and register an entry point
  460.         */
  461.         if RxFuncQuery('DHRSysInfo') then
  462.             call RxFuncAdd 'DHRSysInfo','DHRRU100','DHRSysInfo'
  463.         call DHRSysInfo 'infoval', 'infodesc'
  464.         /* On return, RESULT will contain "0" or > "0" */
  465.         if result > 0 then do
  466.             say 'Error in DHRSysInfo, rc =' result
  467.             exit result
  468.         end
  469.         /* infoval.0 contains the count of variables returned */
  470.         say 'Count of variables returned =' infoval.0
  471.         do varnum = 1 to infoval.0
  472.           say left(infodesc.varnum,30) infoval.varnum
  473.         end
  474.         exit
  475.  
  476.         The call to DHRSysInfo requires one REXX stem variable name and
  477.         optionally a second REXX stem variable name. The variable stem.0
  478.         will contain the count of data item returned in stem.1 through
  479.         stem.n. The first variable name is used to return values. The
  480.         second variable name, if supplied, is used to return descriptions
  481.         for the values in the first variable. A result code of 0 indi-
  482.         cates that the function executed correctly. A result code greater
  483.         than zero will indicate a problem with extracting the information
  484.         or storing the information in a REXX variable. An error message
  485.         will be displayed with more specific information. A parameter
  486.         error will produce a severe REXX error and terminate the CMD
  487.         file.
  488.  
  489.  
  490.  
  491.  
  492.  
  493.  
  494.  
  495.  
  496.  
  497.  
  498.  
  499.  
  500.  
  501.  
  502.  
  503.  
  504.                                         8
  505.  
  506.  
  507.