home *** CD-ROM | disk | FTP | other *** search
-
- Documentation for PUSHDIR/POPDIR Copyright 1989, P. R. Fletcher _________________________________ _______________________________
-
-
- INTRODUCTION ____________
-
- There are many utilities (most in the public domain) which allow you
- to save the name of your current working directory while you go off
- and do something else, and then subsequently to return to where you
- were with a single, (hopefully) easy-to-remember, command. The simpler
- of these utilities create and/or use .BAT files or are otherwise more
- or less inelegant, frequently not allowing more than one previous
- directory name to be saved for later use (i.e PUSHes cannot be
- nested). More complex (and more useful) ones tend to require the
- presence of a TSR "keyboard enhancer" program which may occupy space
- needed for and/or interfere with the functioning of other needed
- programs. The two programs in this ARChive, PUSHDIR and POPDIR, do the
- job well and simply - they allow "pushes" to be nested to arbitrary
- depth and they do not occupy memory (except transiently, while
- actually running). The "stack" of previous directories is kept as an
- ASCII file on disk (in a user-selectable location) and is
- automatically created when necessary and deleted when empty.
-
- The programs are Copyright by Peter R. Fletcher, 1988-9. All rights
- reserved. They were written in C, compiled with the Microsoft C
- compiler (V5.1), and linked with code from the Microsoft C function
- libraries by means of the Microsoft LINK linker (V4.06). They
- consequently contain material that is Copyright by Microsoft Corp,
- 1985-1988. This material is used under the terms of a license from
- Microsoft Corp. These programs and their documentation may be freely
- copied for non-commercial use, provided that they are not modified in
- any way. Commercial use of the programs without the author's prior
- written permission is strictly prohibited - such use may also require
- the payment of a fee.
-
-
- USING THE PROGRAMS __________________
-
- The .EXE files should be kept in one of the directories pointed to by
- your PATH environment variable (keeping them in your current directory
- will also work but rather limits their utility!). The full syntax of
- the commands is as follows:
-
- PUSHDIR [d:[\path\...]]
-
- POPDIR [d:[\path\...]] [INIT | POP | SWAP]
-
- Many people will find it most convenient to use the programs without
- using the optional parameters or paying attention to any of the "bells
- and whistles" discussed below. The command PUSHDIR will save the full
- pathname of the current directory in a file called PUSHLIST.TMP on the
- root directory of the current drive (creating the file if necessary),
- while POPDIR will perform a CHDIR to the last directory whose name was
- PUSHed (after deleting PUSHLIST.TMP if the stack is now empty). The
- three additional command line options for POPDIR are discussed below.
- A POPDIR without a preceding PUSHDIR leaves the current directory
- unchanged.
-
-
-
- Documentation for PUSHDIR/POPDIR Copyright 1989, P. R. Fletcher _________________________________ _______________________________
-
-
- BELLS AND WHISTLES __________________
-
- Using the programs as described above should work well if you only
- need to move between directories on a single device. On a system with __________________
- multiple devices, PUSHDIR's default habit of writing the stack file on
- the root directory of the current device will cause POPDIR to fail if _____________________
- that program is invoked from a different device. The programs provide _______________________
- two solutions for this problem. If you include a drive and path
- specification on the command line (a path without an explicit drive
- specification will be ignored) that path will be used in writing or
- searching for the stack file. The programs also check for the
- existence of a DOS environment variable called PUSHPATH. If this
- variable exists, its value will be taken to be the path to be used for
- the stack file. If PUSHPATH exists and a path is specified on the ___
- command line, the path specified on the command line is used. The DOS
- SET command is used to define PUSHPATH (e.g. SET PUSHPATH=D:\TEMP).
- PUSHPATH can usefully be set to point to a RAMdisk (if you have one),
- since the stack file will then be accessed very rapidly and will
- automatically be deleted when the computer is powered off. If either
- of these methods (command line or environment variable) of specifying
- the path name for the stack file is used, POPDIR will automatically
- change the current device and directory to that saved by the last ____________________
- PUSHDIR.
-
- As noted above, POPDIR does have three other command line options -
- the key words for these may be entered in upper case, lower case, or
- any combination, but they may not be abbreviated: ___
-
- 1) POPDIR INIT unconditionally deletes the stack file (to reinitialize
- the system), and is intended principally for use in AUTOEXEC.BAT
- files.
-
- 2) POPDIR POP "pops" the last directory name off the stack and
- "throws it away" - it leaves the current directory unchanged.
-
- 3) POPDIR SWAP allows you to alternate, at will, between two
- subdirectories. The name of the previous directory is replaced on the
- stack by the name of the current directory before POPDIR moves you ______
- back to the previous one. The next invocation of POPDIR will then put
- you back where you came from. This is much easier to try out than to
- explain!
-
-
- LIMITATIONS AND RESTRICTIONS ____________________________
-
- PUSHDIR and POPDIR do require DOS 2.x or above. However, they use only
- documented DOS 2.x services and require very little memory - they
- should, therefore, run on virtually any hardware. They should also run
- in the DOS compatibility box under OS/2, but this has not yet been
- tested.
-
-
-
-
-
-
-
-
-
- Page 2
-
- Documentation for PUSHDIR/POPDIR Copyright 1989, P. R. Fletcher _________________________________ _______________________________
-
-
- ADDITIONAL INFORMATION ______________________
-
- Like all well-behaved programs (!), these utilities signal successful
- completion by returning to DOS with the ERRORLEVEL variable set to
- zero. Different small positive values are returned for various errors.
- The programs do not display any prompts or error messages - they just
- do their jobs quietly and exit. Paths may be specified on the command
- line or in the PUSHPATH variable with or without the final "\" - the
- "\" will be appended automatically if it is not found. The name of the ____
- stack file cannot be changed without patching the program file (not ___
- recommended). ___________
-
- Comments, suggestions, etc. may be addressed to the author at:
-
- 1515 West Montgomery Avenue
- Rosemont
- PA 19010
- U.S.A.
-
- Please enclose a s.a.e. if you would like to receive a reply to a
- question or a response to a comment.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Page 3
-