home *** CD-ROM | disk | FTP | other *** search
/ Phoenix CD 2.0 / Phoenix_CD.cdr / 02a / pushpath.zip / PUSHPATH.DOC < prev   
Text File  |  1987-02-28  |  2KB  |  66 lines

  1. PUSHPATH Command
  2. POPPATH  Command
  3. ________________
  4.  
  5. Purpose:  To allow saving the current path to a stack-like file 
  6.           and then resetting the path to the last entry in the
  7.           stack.
  8.  
  9. Format:   (1)PUSHPATH
  10.           (2)POPPATH
  11.  
  12. Remarks:  Each call to PUSHPATH appends the current path 
  13.           specification to file c:\path.dat (PUSHPATH creates
  14.           the file if it does not exist).
  15.  
  16.           Each call to POPPATH deletes the most recent addition
  17.           to c:\path.dat and sets the current path to that path
  18.           specification.  POPPATH rewrites c:\path.dat, deleting 
  19.           the most recently-added entry.  (POPPATH deletes the 
  20.           file if removing the most recent addition would leave
  21.           it empty.)
  22.  
  23. Usage:    Normally, these programs would be used when you wish to
  24.           change your path, and then return to the original path.  
  25.           A typical sequence:
  26.  
  27.           PUSHPATH
  28.           PATH=c:\elsewhere;
  29.           [applications commands]
  30.           POPPATH
  31.  
  32.           You can, of course, accomplish the same thing without 
  33.           using these programs.  The sequence created by
  34.           PUSHPATH and POPPATH can, for example, be duplicated 
  35.           with two batch files, PUSH.BAT and POP.BAT:
  36.  
  37.           PUSH.BAT:
  38.           SET OLDPATH=%PATH%
  39.  
  40.           POP.BAT:
  41.           PATH=%OLDPATH%
  42.  
  43.           If I had realized this when I originally wrote PUSHPATH 
  44.           and POPPATH, I doubt that I would have bothered to 
  45.           write them.  The programs, however, do permit you to 
  46.           stack paths, which would be harder with the batch file 
  47.           approach.
  48.  
  49. Method:   PUSHPATH simply looks for "PATH=" in its environment 
  50.           and writes what it finds to a file.
  51.  
  52.           POPPATH uses DOS Interrupt 2eH to set the path.  This 
  53.           interrupt is undocumented, and therefore using it may 
  54.           not be a good idea.  I got what little information I 
  55.           have from Rick Housh's SETENV.PAS, found in SETENV.ARC.  
  56.           Housh got the information from Ray Duncan's December 
  57.           1986 column in Dr. Dobbs' Journal of Software Tools.
  58.  
  59.  
  60.                                    David Seidman
  61.                                    February 28, 1987
  62.  
  63.                                    Please send any comments to me 
  64.                                    on Robert Blacher's BBS,
  65.                                    202-547-2008
  66.