Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

A particular program that I like to use no longer works in TCC/LE

Mar
30
0
Instead of using CD or TCC/LE's CDD, or PUSHD and POPD, I have been using CD Deluxe for a few years, and I like using it and have got very used to it.

I use it on Linux and I used to use it with TCC/LE, but a few updates ago it stopped working, and I have not managed to get it working again.

This is the bit of it (a script) which no longer works:

@echo off
set pushd_tmp=%TEMP%\pushd.tmp
set cdd_tmp_cmd=%TEMP%\cdd.tmp.cmd
pushd > %pushd_tmp%
%~dps0_cdd.exe %* < %pushd_tmp% > %cdd_tmp_cmd%
%cdd_tmp_cmd%

This script is supposed to be called cdd.cmd, but I renamed it to cddd.cmd, because TCC/LE already has a CDD command.

What has changed in TCC/LE which makes this script not work any more? I can see that PUSHD on its own no longer returns the current directory, where as it must have done so in the past.

I've tried making workarounds for that, but it still didn't work, so is there anything else which has changed?
 
JPsoft's PUSHD command in 4DOS, 4NT, TCC and TCCLE NEVER displayed anything but possibly an error message if trying to switch to an inaccessible directory. Likewise, the PUSHD command of CMD.EXE never displays anything, either. Are you sure that your batch file works in CMD, for which it was obiously written?
 
Weird. He's using PUSHD (via a temporary batch file) to change directories, but I don't see him ever doing a POPD. (And why does the author expect to read the current directory from stdin? It's simple for a program to get the current directory itself, without such contrivances....)
 
JPsoft's PUSHD command in 4DOS, 4NT, TCC and TCCLE NEVER displayed anything but possibly an error message if trying to switch to an inaccessible directory. Likewise, the PUSHD command of CMD.EXE never displays anything, either. Are you sure that your batch file works in CMD, for which it was obiously written?

But how could that be, as I used to have it working with TCC/LE? And yes, it works in CMD, and PUSHD does return the current directory in CMD (using Windows 7/Server 2008 R2).
 
Yeah, it's not very elegant, but I really like what it does, like cd - to switch back and forth from directories, and the easy selection of recent directories. I wish TCC/LE did this itself.

Er, TCC/LE does support CD - and CDD - (and has for years.) You can even omit the command; a minus sign by itself is equivalent to CDD -

Try visiting a few different directories, and then press Control PageUp. It's not quite the same as CD Deluxe, but it's similar functionality and at least as easy to use.
 
Likewise, the PUSHD command of CMD.EXE never displays anything, either.

It looks like PUSHD in CMD.EXE dumps the directory stack (not the current directory) to stdout, analogous to DIRS in TCC. So changing the PUSHD to DIRS might solve the problem, or at least be a step towards solving it.

I still think it's pretty weird, though, pushing directories without popping them. I guess it must be the author's approach to instancing the directory history. What happens when you run out of stack?
 
Thanks for your help. I apologise for forgetting to reply. I think I got frustrated with it.

DIRS does sort of work, but the list is the reverse of what the _cdd.exe is expecting. The Ctrl-PgUp list does not work when TCC/LE is wrapped in Console2, which is something I don't want to stop using.

The stack appears to run out of space at around 75 entries, but I'm not sure, and I'll worry about that afterwards.

I'm going to try to understand how this works, and possibly make something myself that does not have these problems, after learning how to do that and once I understand what the problems are exactly. It may take years.
 
Funny I have exactly the same problem - though I really only started using CD Deluxe since reading about it here - and I also had to give up on PgUP because of Console2 (I don't see us getting much joy in this forum for that problem since Console2 is basically a workaround for avoiding paying for the full TCC product - hint: the price of TCC is way too high)

I also worked out that DIRS is the tccle equivalent of pushd with no args, only the list is reversed. Did you find a solution?
 
Thanks ja
Yes, I did. CD Deluxe itself has an option to reverse the history.

http://www.plan10.com/cdd/#options-reference

Tell me how it goes. I only have Linux to hand at the moment, where I also use CD Deluxe.


thanks jason404.
But are you saying you set the option to always use forwards instead of backwards by default? Doesn't that prevent cdd from working properly?
BTW: I've been trying by piping the output of DIRS into a different command - I have cygwin installed so I'm using tac - but I've been running into a problem for a while were output and piping from many commands is adding blank spaces - which turn out to be NULL characters (ascii 0) in the output. I guess I should create a different post about that
 
I really cannot remember if I got it working or not by using that option. I use a variety of environments, so I get a bit jumbled up, but I remember having TCC/LE, Console2 and CD Deluxe working together.

Try it and tell me if it works please. Cheers.
 
This script is supposed to be called cdd.cmd, but I renamed it to cddd.cmd, because TCC/LE already has a CDD command.

While not a solution to your problem, if you want to use an external command, in your case, cdd.cmd, in place of an internal command, in your case, cdd, consider using the ALIAS command as follows;

Code:
alias cdd=c:\utils\cdd.cmd

Change the directory to where ever your cdd.cmd file is located.

If you want to use the internal cdd command, while your alias is active, simply precede cdd with an asterisk, as follows;

Code:
*cdd

Just a tip for future reference.

Joe
 
Thanks Joe, I was doing that, but now I've actually managed to replace the entire "cdd.cmd" with an alias, and solve the problem. Also thanks to Steve Fabian who solved my problem with the null characters (on another thread: solution was the Unicode box was checked in options).

So here's how I solved the original posts problem and got rid of the cmd script altogether. I used this alias:

cd=%@execstr[dirs | tac | "c:\Program Files (x86)\Cd Deluxe\_cdd.exe" %1$ ]


The key points are:
  • I'm using the cygwin "tac" command which is reverse cat for reversing the list that comes out of TCC/LE DIRS so that matches the order out of Windows PUSHD-with-no-args
  • I would really like to use a TCC/LE command or function here, but I can't find one: HEAD, TAIL and TYPE all have options for ordering, but these all seem to sort, and are not available in the free LE version. If anyone has ideas for a non-cygwin way to reverse the list of lines output from a command, please let me know (it won't really affect me now since I have cygwin anyway, but it would make this alias generally more useful for other CDD Deluxe users)
  • Getting rid of the unnecessary input file generation and redirection was easy: I just piped DIRS to TAC to the _cdd.exe program
  • Getting rid of the output file which is then executed as a command, was harder - I was looking for the TCC/LE equivalent of the unix `backticks` which are replaced with the string result of a command and finally found it with the @execstr function. That's why that is there.
  • Also note that I aliased this to CD not to CDD or even CDDD. This way all my "CD" commands are through this tool - I find that easier than picking up a new habit. Meanwhile in the rest of my aliases and batch (and btm) scripts I try to use the TCC/LE CDD command to change directories. It's more robust anyway, and now it avoids using the CD Deluxe script which is safer and avoids polluting the DIRS stack with directories used by scripts
So the whole line now reads like this: "Execute the string that results from feeding the reversed output of DIRS to the _cdd.exe command"
which is basically what the cmd.exe was doing.
Note that you CAN use it without the CYGWIN TAC command in there. But the order will be reversed. This is okay, as long as you get into the habit of using CD + and ++ instead of - (Also you will want to add --direction=+ so that, when you CD with no args, it lists them in the + order)
So far this is working well but for one caveat: the piping to TAC is slowww. Not too slow, but noticeable. I would really love to take that out, and so my wish list would be:
  • find me a TCC/LE line reverser that negates the need for TAC
  • Please add arguments to PUSHD to allow it to be consistent with CMD in that it dumps the dir stack when used with no other args
  • Failing that, please add an arg to DIRS to reverse the list to be consistent with CMD's PUSHD with no args, and
  • Please add an arg to DIRS to suppress the red error message when the dirstack is empty. This doesn't affect CD Deluxe, but is annoying to see
hope this helps
 
Okay here we go with Cygwin/TAC free option.

The caveat here is that I don't care to use the + options in CD Deluxe for going forward usually, so I'm doing without them.
Specifically I'm using the TCC/LE @REPLACE function to replace all instances of "-" in the command line with "+" so that I can use "-" for what its meant for - even though the list is reversed.
I'm also using the CD Deluxe command line option "--action=+?" to make the default action to list the dirs in the + order, so when I do a plain "CD" I see them in the order that they'll be used with "CD -Number"
(Albeit I don't see the "-" in front of each line that CD Deluxe would normally put there".

The end result is this:

cd=%@execstr[dirs | "c:\Program Files (x86)\Cd Deluxe\_cdd.exe" --action=+? %@replace[-,+,%1$] ]

works for me - and is nice and fast
 
Well, this may be overkill for your purposes:
http://prospero.unm.edu/plugins/textutils.html#upend
thank you. That is better than using tac. A tiny bit faster but still slow and at least not cygwin specific. My new alias is now
%@execstr[dirs | upend | "c:\Program Files (x86)\Cd Deluxe\_cdd.exe" ]

I had to abandon my trick above of replacing - with + because it only took me an hour to run into a directory with a "-" in the middle of the directory name. Doh!

Shame though because using the @REPLACE was much much faster than piping to TAC or UPEND - both of which are noticeably slow
 
I think we went through reversing output lines in the support forum. I found no indication that TPIPE is **not** in LE. So ...
Code:
v:\> echo My^ndog^nhas^nfleas. | tpipe /simple=34
fleas.
has
dog
My
 
I think we went through reversing output lines in the support forum. I found no indication that TPIPE is **not** in LE. So ...
Code:
v:\> echo My^ndog^nhas^nfleas. | tpipe /simple=34
fleas.
has
dog
My
Odd - I can't find TPIPE as a command even in Help.
Not even in the list of TCC commands in the page which compares them with TCC/LE. It seems external to both.
I thought maybe you were mixing it up with a 3rd party command, but I googled it and, while it does come up as a linux command, the 6th hit on google was a link to this support forum where it is discussed.
 
discontinued! didn't know that. what a pity.

It's still available as a free download, but it's unsupported (other than peer-to-peer advice in these forums) and no new capabilites will be added to it, so the only option if you need any of the recently added functionality is the full fat, paid for version.

Rex wrote an informative blog post explaining the decision to discontinue the LE verison.
 
Bugs relating to its current features are still fixed, but no new features are added. TCCLE 13.06.75 was released near the beginning of this month (March 2013).
 
Back
Top