Path: utzoo!attcan!uunet!timbuk!cs.umn.edu!ub.d.umn.edu!rutgers!usc!zaphod.mps.ohio-state.edu!van-bc!ubc-cs!fs1!fs1.ee.ubc.ca!jthornto From: jthornto@fs1.ee.ubc.ca (THORNTON JOHAN A) Newsgroups: comp.sys.handhelds Subject: PUSHD and POPD Summary: utilities Keywords: directory push/pop Message-ID: <1447@fs1.ee.ubc.ca> Date: 19 Nov 90 12:52:20 GMT Sender: root@fs1.ee.ubc.ca Reply-To: jthornto@fs1.ee.ubc.ca (THORNTON JOHAN A) Followup-To: comp.sys.handhelds Organization: Dept. of Electrical Engineering University of B.C. Lines: 40 Here are PUSHD and POPD, two utilities that I find often come in handy. PUSHD of course saves your current directory in a directory stack, and POPD pulls off the last place where you were. The directory paths are stored as lists in a list called DPATH, which you must create in the root directory. ( HOME {} 'DPATH' STO ) I hope you are using the HOME-MAIN utility management method; put the programs in the HOME directory. If you're stingy with memory, kill the error message from POPD - remove everything between DROP and END. @ PUSHD - push current directory %%HP: T(3)A(D)F(.); \<< PATH DUP 1 \->LIST HOME 'DPATH' STO+ EVAL \>> @ POPD - pop directory %%HP: T(3)A(D)F(.); \<< HOME DPATH OBJ\-> DUP IF THEN 1 - \->LIST 'DPATH' STO EVAL ELSE DROP "POPD Error:" 1 "Directory Stack Empty" 2 DISP DISP 1 FREEZE END \>> ------- _/__/ ----------------------------------------------------- _| ___| E l e c t r i c a l | Johan Thornton, Esq. | | |_/ E n g i n E E r i n g |------------------------- |/| __| U n i v e r s i t y | jthornto@fs1.ee.ubc.ca |-| |/__ o f B r i t i s h |------------------------- | |_____| C o l u m b i a | This space for rent ---- |__|/_| ------------------------------------------------------