home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   alt.msdos.batch.nt      Fun with Windows NT batch files      68,980 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 67,820 of 68,980   
   Zaidy036 to MikeS   
   Re: Question about pushd/popd   
   03 Nov 21 16:52:31   
   
   From: Zaidy036@air.isp.spam   
      
   On 11/3/2021 4:07 AM, MikeS wrote:   
   > On 02/11/2021 20:11, Kenny McCormack wrote:   
   >> CMD.EXE has a version of the pushd/popd commands, obviously based on the   
   >> pre-existing commands in the Unix shells (starting with csh, about 4   
   >> decades ago).   
   >>   
   >> However, as far as I can tell, the DOS/Windows implementations of these   
   >> commands is missing one key functionality - that is, the ability to see   
   >> what is on the stack.  That is, to see what you will get if you do   
   >> "popd".   
   >> And, in fact, IMHO, it's not really worth much to have the stack and   
   >> to be   
   >> able to "pop" if you have no idea where you're going to pop to.   
   >>   
   >> Note, BTW, that you might argue that you should know where pop is   
   >> going to   
   >> take you, because you should remember where you were before you did the   
   >> last "push".  This may or may not be true, but what if you've push'd   
   >> multiple times?  You can't be expected to remember everything, can you?   
   >>   
   >> So, I hope I'm missing something.  Is there any way to tell what   
   >> directories are currently in "the stack" ?   
   >>   
   > They are intended to be used in (batch) programs and work the same as   
   > push and pop a register value in languages like MASM. As you said, if   
   > pushd is used several times without popd your program needs to keep   
   > track of the directories pushed and their order. You can only recover a   
   > lower item in the stack by popping off those above first.   
      
   Since you are doing manually why not make a small batch to add dir into   
   a txt file before the popd and repeat the batch as needed so the txt   
   file has a list in order you did the popd's.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca