1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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

Discussion in 'TCC/LE Support' started by jason404, Apr 2, 2012.

  1. jason404

    Joined:
    Mar 21, 2011
    Messages:
    30
    Likes Received:
    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?
     
  2. Steve Fabian

    Joined:
    May 20, 2008
    Messages:
    3,520
    Likes Received:
    4
    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?
     
  3. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,304
    Likes Received:
    39
    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....)
     
  4. jason404

    Joined:
    Mar 21, 2011
    Messages:
    30
    Likes Received:
    0
    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).
     
  5. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,304
    Likes Received:
    39
    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.
     
  6. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,304
    Likes Received:
    39
    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?
     
  7. jason404

    Joined:
    Mar 21, 2011
    Messages:
    30
    Likes Received:
    0
    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.
     
  8. rhubarb

    Joined:
    Mar 26, 2013
    Messages:
    13
    Likes Received:
    0
    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?
     
  9. jason404

    Joined:
    Mar 21, 2011
    Messages:
    30
    Likes Received:
    0
  10. rhubarb

    Joined:
    Mar 26, 2013
    Messages:
    13
    Likes Received:
    0
    Thanks ja

    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
     
  11. jason404

    Joined:
    Mar 21, 2011
    Messages:
    30
    Likes Received:
    0
    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.
     
  12. Joe Caverly

    Joined:
    Aug 28, 2009
    Messages:
    680
    Likes Received:
    8
    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
     
  13. rhubarb

    Joined:
    Mar 26, 2013
    Messages:
    13
    Likes Received:
    0
    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
     
  14. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,304
    Likes Received:
    39
  15. rhubarb

    Joined:
    Mar 26, 2013
    Messages:
    13
    Likes Received:
    0
    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
     
  16. rhubarb

    Joined:
    Mar 26, 2013
    Messages:
    13
    Likes Received:
    0
    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
     
  17. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,949
    Likes Received:
    30
    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
     
  18. rhubarb

    Joined:
    Mar 26, 2013
    Messages:
    13
    Likes Received:
    0
    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.
     
  19. Dan Glynhampton

    Joined:
    Feb 26, 2013
    Messages:
    100
    Likes Received:
    0
    TPIPE was new in v14 of TCC, which was released after TCC/LE development was discontinued.

    Dan
     
  20. rhubarb

    Joined:
    Mar 26, 2013
    Messages:
    13
    Likes Received:
    0
    discontinued! didn't know that. what a pity.
     
  21. Dan Glynhampton

    Joined:
    Feb 26, 2013
    Messages:
    100
    Likes Received:
    0
    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.
     
  22. JohnQSmith

    Joined:
    Jan 19, 2011
    Messages:
    559
    Likes Received:
    7
    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).
     
  23. Charles Dye

    Charles Dye Super Moderator
    Staff Member

    Joined:
    May 20, 2008
    Messages:
    3,304
    Likes Received:
    39
    As it's licensed software, I'm not sure that Rex could give it away with the free product even if he wanted to....
     
  24. Dan Glynhampton

    Joined:
    Feb 26, 2013
    Messages:
    100
    Likes Received:
    0
    Yes, that's true, and I think if Microsoft make changes to CMD that introduce incompatibilites with TCC/LE then they will be addressed too.
     
  25. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,856
    Likes Received:
    83
    Definitely not discontinued. However, the only major new features TCC/LE will get will be whatever Microsoft adds to CMD. Bug and compatibility fixes will continue.
     
  26. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,856
    Likes Received:
    83
    I could, but (as with VIEW) if TPIPE were in TCC/LE, I'd have to pay for the TCC/LE users. Since the TCC/LE users aren't paying me back, it wouldn't be a very wise business decision.
     

Share This Page