home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Phoenix CD 2.0
/
Phoenix_CD.cdr
/
02a
/
pushpath.zip
/
PUSHPATH.DOC
< prev
Wrap
Text File
|
1987-02-28
|
2KB
|
66 lines
PUSHPATH Command
POPPATH Command
________________
Purpose: To allow saving the current path to a stack-like file
and then resetting the path to the last entry in the
stack.
Format: (1)PUSHPATH
(2)POPPATH
Remarks: Each call to PUSHPATH appends the current path
specification to file c:\path.dat (PUSHPATH creates
the file if it does not exist).
Each call to POPPATH deletes the most recent addition
to c:\path.dat and sets the current path to that path
specification. POPPATH rewrites c:\path.dat, deleting
the most recently-added entry. (POPPATH deletes the
file if removing the most recent addition would leave
it empty.)
Usage: Normally, these programs would be used when you wish to
change your path, and then return to the original path.
A typical sequence:
PUSHPATH
PATH=c:\elsewhere;
[applications commands]
POPPATH
You can, of course, accomplish the same thing without
using these programs. The sequence created by
PUSHPATH and POPPATH can, for example, be duplicated
with two batch files, PUSH.BAT and POP.BAT:
PUSH.BAT:
SET OLDPATH=%PATH%
POP.BAT:
PATH=%OLDPATH%
If I had realized this when I originally wrote PUSHPATH
and POPPATH, I doubt that I would have bothered to
write them. The programs, however, do permit you to
stack paths, which would be harder with the batch file
approach.
Method: PUSHPATH simply looks for "PATH=" in its environment
and writes what it finds to a file.
POPPATH uses DOS Interrupt 2eH to set the path. This
interrupt is undocumented, and therefore using it may
not be a good idea. I got what little information I
have from Rick Housh's SETENV.PAS, found in SETENV.ARC.
Housh got the information from Ray Duncan's December
1986 column in Dr. Dobbs' Journal of Software Tools.
David Seidman
February 28, 1987
Please send any comments to me
on Robert Blacher's BBS,
202-547-2008