home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-387-Vol-3of3.iso / r / retain11.zip / RETAIN.DOC < prev    next >
Text File  |  1992-12-10  |  11KB  |  189 lines

  1. --- RETAIN 1.1 by Jim Groeneveld, 10/12-92, retains current path.
  2.     Pure BATch equivalent of PUSH/POPDIR, up to 8 levels, no TSR.
  3.     Optionally shows all nested path levels.
  4.  
  5. ===CONTENTS of package===
  6. This package (.ZIP) includes the following files:
  7. RETAIN   BAT      14,310  12-10-92  01:10:00  Original BATch program RETAIN
  8. RETAINCD BAT       1,387  12-10-92  01:10:00  Combination of RETAIN and CD
  9. $RETURN$ AUX          28  08-27-92  06:00:00  Auxiliary file (necessary)
  10. RETAIN   DOC      11,157  12-10-92  01:10:00  This documentation file
  11.  
  12. ===USAGE: RETAIN current path===
  13. Enter 'RETAIN [aux-path[aux-file]│*│[/│-]?]' from the directory to retain;
  14. aux-path = drive:\subdir\ of auxiliary file $RETURN$.AUX, incl. trailing '\';
  15. aux-file = the eventual alternate auxiliary file name for $RETURN$.AUX;
  16. *        = list the currently stored paths (also with 'RETURN *');
  17. ? (or /? or -?) = display this help.
  18. DO NOT SPECIFY OTHER PARAMETERS. THIS WILL PRODUCE ERRONEOUS RESULTS!
  19. RETAIN may be called successive times to store up to 8 paths.
  20.  
  21. ===USAGE: RETURN to previous path===
  22. Enter 'RETURN' (the literal command, not only the RETURN/ENTER-key) to return 
  23. to the very last path stored in the path list (no parameters!). This path is 
  24. removed from the list and RETAIN thus has one more level to store the next time.
  25. Enter 'RETURN *' to list the currently stored paths.  
  26.  
  27. ===USAGE: RETAINCD to retain current path and change drive:subdirectory===
  28. Enter 'RETAINCD drive┼path [aux-path[aux-file]│*│[/│-]?]', in which:
  29. drive    = drive specification to CD to, e.g. 'C:';
  30. path     = absolute (\[...[\...]]) or
  31.            relative   (...[\...]) path specification to CD to.
  32.     At least one of these (either drive or path) or both _must_ be specified.
  33. aux-path = drive:\subdir\ of auxiliary file $RETURN$.AUX, incl. trailing '\';
  34. aux-file = the eventual alternate auxiliary file name for $RETURN$.AUX;
  35. *        = list the currently stored paths (also with 'RETURN *');
  36. ? (or /? or -?) = display this help.
  37.  
  38. ***WARNING!!!***
  39. MANY (LONG) PATHS MAY CAUSE BAT FILE LINES TO EXCEED 127 CHARACTERS.
  40. THIS WILL CREATE UNPREDICTABLE, AND ERRONEOUS RESULTS!!!!!!!!!!!!!!!
  41. IN SOME INSTANCES THE SYSTEM MAY EVEN HANG OR CRASH! Thus, though the algorithm
  42. is correct the DOS command line length limitation may restrict its use.
  43.  
  44. ===Determination of location (and name) of auxiliary file $RETURN$.AUX===
  45. The auxiliary file $RETURN$.AUX will be searched for in the paths or as the
  46. full file specification (eventually with different, alternative filename and
  47. extension) from the data below in that order until it is found.
  48. a. the first and only parameter when calling RETAIN
  49.    1. the full _path_ only, incl. trailing '\' (e.g. 'RETAIN C:\UTIL\') or
  50.    2. the full _file_specification_ (e.g. 'RETAIN C:\UTIL\AUX-FILE.$$$')
  51. b. the environment variable %RETAIN% (specify environment variable RETAIN
  52.    either from the DOS prompt or in AUTOEXEC.BAT) (DOS 3.x and above only)
  53.    1. the full _path_ only, incl. trailing '\' (e.g. 'SET RETAIN=C:\UTIL\') or
  54.    2. the full _file_specification_ (e.g. 'SET RETAIN=C:\UTIL\AUX-FILE.$$$')
  55. c. the ROOT directory of C: (C:\) (or automatically any APPENDed path)
  56. d. the ROOT directory of the CURRENT drive (\)
  57. e. the CURRENT directory (.\)
  58. f. the PARENT directory of the current one (..\)
  59. g. the SAME directory where RETAIN.BAT is residing:
  60.    if EXPLICITELY specified when starting RETAIN (by path, DOS 3.x&up only)
  61.    (NOT if RETAIN.BAT can only be found via the PATH!) (e.g. 'C:\UTIL\RETAIN')
  62. h. the DOS 3.x PATH variable (this may take quite a while), new in version 1.1
  63.  
  64. So make sure to place or name $RETURN$.AUX such that it can be found in one of 
  65. these ways. All this effort is done because the DOS ECHO command can not write 
  66. lines without CRLF, so an external auxiliary file is necessary that already 
  67. contains such a line.  
  68.  
  69. ===Further remarks===
  70. If using DOS 3.2&up and using the APPEND path utility do at least specify the
  71. '/X' parameter when calling APPEND for the first time or the auxiliary file
  72. still can not be found.
  73.  
  74. It is handy to put RETAIN.BAT in a directory that is in your path (e.g.
  75. C:\UTIL) and to have C:\ in your path in order to be able to find the temporary
  76. created file C:\RETURN.BAT from any drive:subdirectory.
  77.  
  78. In order to restart each time with an empty list when the system is booted
  79. add the following statement to your AUTOEXEC.BAT file:
  80. IF EXIST C:\RETURN.BAT DEL C:\RETURN.BAT    (eventually redirect this to NUL)
  81.  
  82. C:\RETURN.BAT is being created explicitely in C:\ in order to have only
  83. ONE RETURN.BAT on a system. If you do not have a C: drive choose one of:
  84. a. manually change all references to C:\ within this BATch file into A:\
  85. b. add a command to your AUTOEXEC.BAT file: 'SUBST C: A:\', which after
  86.    reboot will cause references for drive C: to go to drive A:.
  87.  
  88. Take care to write-enable C: (or A:) and not to have the drive or the root's
  89. directory entry table full!
  90.  
  91. ===Minimal system requirements===
  92. IBM-PC (88/86/x86) or compatible
  93. 64kb memory
  94. (MS)DOS 2.x or above; the program has been developed for DOS 3.x and above.
  95. In order to make it run under DOS 2.x one should change the appropriate lines
  96. within the .BAT file as indicated there. That is necessary because with DOS 2.x
  97. a program can not be called by specifying a path before its name.
  98.  
  99. With DOS 2.x the environment variable RETAIN can not be used either. Besides,
  100. the DOS PATH can not be scanned for the auxiliary file. Another adaptation for
  101. DOS 2.x to include is to change .BAT file lines 'ECHO.' into 'ECHO @', in which
  102. '@' means the ascii-255 character, thus 'echo  ', or it prints "ECHO is off".
  103. Furthermore, with DOS 3.3&up one might change 'echo off' into '@echo off'.
  104. The DOS 3.3&up CALL command does not occur within RETAIN, though it does within
  105. RETAINCD. If used with lower DOS versions it may be changed into 'COMMAND/C' or
  106. one might apply an external CALL command for the lower DOS versions (by me too).
  107.  
  108. Though not explicitely stated there these adaptations already might have been
  109. applied to RETAIN version 1.0 too.
  110.  
  111. ===New in version 1.1===
  112. The DOS PATH environment string is used to search additionally for $RETURN$.AUX
  113. if it could not be found elsewhere (not specified on the command line or as
  114. environment variable RETAIN). One general method, using a recursive call to
  115. RETAIN (somewhat more complicated) with the PATH as the arguments, is being
  116. used. There has been thought of an alternative method, using the PATH variable
  117. directly, but that one has some important drawbacks, as outlined below:
  118.  
  119. rem ---DOSPATH---
  120. rem 'if' line below may cause the system to crash with a too long path. Besides,
  121. rem the test may not work correctly because the path consists of more than one
  122. rem specification, separated by the delimiter ';', though it seems to work if
  123. rem it reads "%path%"=="", but not if it reads ""=="%path%".
  124. rem So do not include it, but let the sub itself find _no path_ eventually
  125. if "%path%"=="" goto notfound
  126. for %%p in (%path%) do if exist %%p\$RETURN$.AUX %0 %%p\ .auxpath_checked
  127. rem above: subdirectories; below: root directories;
  128. for %%p in (%path%) do if exist %%p$RETURN$.AUX %0 %%p .auxpath_checked
  129. :notfound
  130. goto nopath
  131.  
  132. A complete path specification (environment space) may be 127 characters long
  133. including the "PATH=" part of the DOS command to set the path, leaving a
  134. maximum of 122 for the actual path specification. This would leave too less
  135. space for the rest of (the 'if' and) the 'for' line. So these lines may work
  136. well with short paths, but may cause the system to hang with longer paths. The
  137. choosen method allows for longer paths and has preference. Besides, if the
  138. path is too long for the command line, this alternate method would cause the
  139. system to crash, while the applied method automatically ignores the extending
  140. path characters and causes the batch file to continue (the last examined path
  141. entry may be truncated and probably does not cause the auxiliary file to be
  142. found). In the worst case extending path entries are not searched, so do not
  143. yield an eventual positive result: thus the auxiliary file will not be found in
  144. that case.
  145.  
  146. ===History===
  147. History of RETAIN (previous 0.versions under different names):
  148.  
  149.  version │.BAT like │  generated   │    auxiliary    │ description of changes
  150. ──date───┼─pushdir──┼──popdir.bat──┼──────file───────┼───────────────────────
  151.  2/11-89 │ SAVE-DIR │ C:\LOAD-DIR  │    CHANGE.COM   │ initial version.
  152.  4/ 4-90 │ REMINDIR │ C:\BACK2DIR  │ C:\CD─SP─NO.EOF │ standard DOS only;
  153.          │          │              │                 │ add. params are next pg.
  154.  6/ 4-90 │ REMINDIR │ C:\BACK2DIR  │    CD─SP─NO.EOF │ aux. in other subdirs.
  155. 19/ 9-91 │ REMIND   │ C:\RECALL    │ C:\$RECALL$.TMP │ faster new algorithm;
  156.          │          │              │                 │ other subdirs removed;
  157.          │          │              │                 │ add. params removed;
  158.          │          │              │                 │ remembered subdir check.
  159. 20/ 8-92 │ REMEMBER │ C:\RESETDIR  │    $RESET$.TMP  │ env.var=subdir or
  160.          │          │              │                 │ other subdirs searched;
  161.          │          │              │                 │ better subdir check.
  162. 27/ 8-92 │ RETAIN   │ C:\RETURN    │    $RETURN$.AUX │ nesting up to 8 levels;
  163.  vs. 1.0 │          │              │                 │ list stored paths;
  164.          │          │              │                 │ aux. in more subdirs;
  165.          │          │              │                 │ further improvements;
  166.          │          │              │                 │ utility RETAINCD.BAT .
  167. 10/12-92 │ RETAIN   │ C:\RETURN    │    $RETURN$.AUX │ aux. file specification;
  168.  vs. 1.1 │          │              │ or any if full  │ aux. may be in DOS PATH;
  169.          │          │              │ path & file name│ aux.spec. with RETAINCD;
  170.          │          │              │ specified as arg│ chk valid C:\RETURN.BAT;
  171.          │          │              │ or env.var.     │ adaptable for DOS 2.x;
  172.          │          │              │  .\$RETAIN$.BAT │ major internal changes.
  173.          │          │              │ temporary file  │
  174.          │          │              │ in current dir. │
  175.  
  176. ===Future===
  177. - multiple RETURN files, allowing different 'memory' sets.
  178. If there are enough requests from users:
  179. - deletion of a specific path level (by sequence number) from the list,
  180.   e.g. 'RETAIN .n' in which n=1..8 (or 'FORGET n' calling 'RETAIN .n').
  181.  
  182. ───────────────────────────────────────────────────────────────────────────────
  183. Centrum voor Medische Informatica TNO       <Email>              |  |  |\/|
  184. TNO Center for Medical Informatics | GROENEVELD@CMI.TNO.NL  |  \_/  |  |  |
  185. ( CMI-TNO )    | Y. Groeneveld     | GROENEVELD@CMIHP1.UUCP | Jim Groeneveld
  186. P.O.Box 124    | Wassenaarseweg 56 | GROENEVELD@TNO.NL      | Schoolweg 14
  187. 2300 AC Leiden | 2333 AL Leiden    |                        | 8071 BC Nunspeet
  188. Nederland.     | (+31|0)71-181810  | Fax (+31|0)71-176382   | 03412-60413
  189.